public CustomUserDetailsEditModel SaveUserDetails (CustomUserDetailsEditModel model) { var result = new CustomUserDetailsEditModel (); var details = new CustomUserDetails (); details.Update (model); var saved = _customUserDetailsDal.Save (details); //result.Update(saved); result.Update (saved); return result; }
public CustomUserDetails Save(CustomUserDetails d) { if (d.DetailsId >= 1) { _appDbContext.Update(d); // _appDbContext.Add(d); _appDbContext.SaveChanges(); return(d); } var result = new CustomUserDetails(); result.Update(d); _appDbContext.Add(result); _appDbContext.SaveChanges(); return(result); }