Ejemplo n.º 1
0
        public static ShopUser UpdateUserFromRequestCreateAddress(this ShopUser user, UpdateUserRequest request)
        {
            user.Name    = request.Name;
            user.Surname = request.Surname;
            user.Phone   = request.Phone;
            Address newAddress = new Address()
            {
                Name     = request.Address.Name,
                Surname  = request.Address.Surname,
                Street   = request.Address.Street,
                City     = request.Address.City,
                Country  = request.Address.Country,
                Postcode = request.Address.Postcode
            };

            user.Address = newAddress;
            return(user);
        }
Ejemplo n.º 2
0
 public static ShopUserProfile GetUserProfile(this ShopUser user)
 {
     return(new ShopUserProfile {
         Email = user.Email, Name = user.Name, Surname = user.Surname, Phone = user.Phone, Address = user.Address
     });
 }