public static Admin ToModel(this AdminEditViewModel model)
 {
     return(new Admin
     {
         ID = model.ID,
         User = new User
         {
             ID = model.ID,
             Name = model.Name,
             UserName = model.UserName,
             Password = model.Password,
             Email = model.Email,
             Phone = model.Phone,
             Photo = model.Photo,
             UserRoles = new List <UserRole>()
             {
                 new UserRole()
                 {
                     ID = 0,
                     RoleID = 1,
                     UserID = model.ID
                 }
             }
         },
     });
 }
Ejemplo n.º 2
0
 public static Admin ToModel(this AdminEditViewModel EditModel)
 {
     return(new Admin()
     {
         ID = EditModel.ID,
         UserName = EditModel.UserName,
         Password = EditModel.Password,
     });
 }