private void UpdateEFUserFromUserModel(model.User user, User EFUser) { EFUser.FirebaseUid = user.FirebaseUID; EFUser.EmailSharingConsent = user.EmailSharingConsent; EFUser.HmscontactConsent = user.HMSContactConsent; EFUser.IsVolunteer = user.IsVolunteer; EFUser.MobileSharingConsent = user.MobileSharingConsent; EFUser.OtherPhoneSharingConsent = user.OtherPhoneSharingConsent; EFUser.PostalCode = user.PostalCode; EFUser.SupportRadiusMiles = user.SupportRadiusMiles; EFUser.SupportVolunteersByPhone = user.SupportVolunteersByPhone; UpdateEFPersonalDetailsFromModelPersonalDetails(user.UserPersonalDetails, EFUser.PersonalDetails); }
public int ModifyUser(model.User user) { User EFUser = _context.User .Include(i => i.PersonalDetails) .Where(a => a.Id == user.ID).FirstOrDefault(); if (EFUser != null) { UpdateEFUserFromUserModel(user, EFUser); _context.SaveChanges(); return(EFUser.Id); } else { return(-1); } }