Example #1
0
 public UserModel CreateViewModel(ApplicationUser datamodel)
 {
     if (datamodel == null) { throw new ArgumentNullException("datamodel"); }
     return new UserModel
     {
         Url = _UrlHelper.Link("GetUserById", new { id = datamodel.Id }),
         Id = datamodel.Id,
         UserName = datamodel.UserName,
         Email = datamodel.Email,
         DateOfBirth = datamodel.DateOfBirth,
         Job = datamodel.Job,
         Gender = datamodel.Gender,
         Fitness = datamodel.Fitness
     };
 }
Example #2
0
 internal ApplicationUser CreateModel(UserModel model, ApplicationUser datamodel = null)
 {
     var result = datamodel ?? new ApplicationUser();
     result.DateOfBirth = model.DateOfBirth;
     result.Fitness = model.Fitness;
     result.Gender = model.Gender;
     result.Job = model.Job;
     result.UserName = model.UserName;
     result.Email = model.Email;
     return result;
 }