Hi All,
Please help me anybody on this.
I am getting below error while save data into database.
I am using Code firtst entity Framework.
error is this. error on Updating record "An error occurred while updating the entries. See the inner exception for details.
Model is
[Key]
public int UserId { get; set; }
public User SaveUser(User user)
{
try
{
if (user.UserId == 0)
{
var UserId = objSequenceHelper.GetNextValue(DomainModels.Enumerations.Sequences.S_SECURITY_USER);
//StoreGeneratedPattern.Identity.ToString();
user.UserId = UserId;
db.Users.Add(user);
}
else
db.Entry(user).State = System.Data.EntityState.Modified;
db.SaveChanges();
return user;
}
}
while saving geting above error .