public User Update(User record) { MYS_USER updatedRecord = UserMapper.ConvertToDBRecord(record); var user = Container.Table_User.Attach(updatedRecord); if (Container.SaveChanges() == 1) { record.Id = user.Id; } return(record); }
public User Insert(User record) { MYS_USER newRecord = UserMapper.ConvertToDBRecord(record); var userMessage = Container.Table_User.Add(newRecord); Container.SaveChanges(); record.Id = userMessage.Id; return(record); }