I've got problem in repository pattern while saving. this is what I wrote in unit of work:
public void Save()
{
db.SaveChanges();
}'
db is for my UserList table
when I write user name and try to change the password, the error shows this: System.Data.Entity.Validation.DbEntityValidationException
here is my code for changing the password:
using (UnitOfWork db = new UnitOfWork())
{
var q = db.UList.Get();
if(q != null)
{
UserList U = new UserList()
{
Password = NewPassText.Text
};
db.UList.Update(U);
db.Save();
this.Hide();
ProFrm ProFrm = new ProFrm(); ProFrm.Show();
}
else
{
}