I have this function: (I'm new with EF)
public sis_user Save(sis_user user, bool edit)
{
if (edit)
{
//How to edit?
sis_user userAux =_context.sis_user.FirstOrDefault(x => x.login == user.login);
_context.SaveChanges();
return user;
}
//To add.
_context.sis_sis_user.Add(user);
_context.SaveChanges();
return user;
}
I can add values, but I'm not sure how to edit a existing one...