I have some columns in table Tbl_User
, but I want to insert data into two of them - not all - and I don't know how can write this code.
I created a repository and this code save all of data to table:
public bool InsertUser(Tbl_User t)
{
db.Tbl_User.Add(t);
return Convert.ToBoolean(db.SaveChanges());
}
but I want to save just in UserName
and Password
columns.
I created a viewmodel like this, but I don't know what shall I do?
public int ID { get; set; }
public string UserName { get; set; }
public string Password { get; set; }