public static void ToDomainModel(User user, UserBasicInfoViewModel userBasicInfoViewModel)
 {
     user.Email     = userBasicInfoViewModel.Email;
     user.UserName  = userBasicInfoViewModel.Email;
     user.FirstName = Convert.ToBase64String(AES.Encrypt(userBasicInfoViewModel.FirstName));
     user.LastName  = Convert.ToBase64String(AES.Encrypt(userBasicInfoViewModel.LastName));
 }
        public static User ToDomainModel(UserBasicInfoViewModel userBasicInfoViewModel)
        {
            User user = new User();

            ToDomainModel(user, userBasicInfoViewModel);
            return(user);
        }
        public static UserBasicInfoViewModel ToViewModel(User user)
        {
            UserBasicInfoViewModel userBasicInfoViewModel = new UserBasicInfoViewModel();

            ToViewModel(user, userBasicInfoViewModel);
            return(userBasicInfoViewModel);
        }
 public static void ToDomainModel(User user, UserViewModel userViewModel)
 {
     UserBasicInfoViewModel.ToDomainModel(user, userViewModel);
     if (!string.IsNullOrWhiteSpace(userViewModel.Id))
     {
         user.Id = userViewModel.Id;
     }
 }
        public static UserViewModel ToViewModel(User user)
        {
            UserViewModel userViewModel = new UserViewModel();

            UserBasicInfoViewModel.ToViewModel(user, userViewModel);
            userViewModel.Id = user.Id;

            return(userViewModel);
        }
 public static void ToViewModel(User user, UserBasicInfoViewModel userBasicInfoViewModel)
 {
     userBasicInfoViewModel.Email     = user.UserName;
     userBasicInfoViewModel.FirstName = AES.Decrypt(Convert.FromBase64String(user.FirstName));
     userBasicInfoViewModel.LastName  = AES.Decrypt(Convert.FromBase64String(user.LastName));
 }