Ejemplo n.º 1
0
        public UserAddressDTO Update(UserAddressDTO oUserAddressDTO)
        {
            UserAddressDTO returnUserAddress = null;
            if (oUserAddressDTO != null && oUserAddressDTO.UserAddressID > 0)
            {
                oUserAddressRepo.UpdateUserAddress(0, UserAddressAssembler.ToEntity(oUserAddressDTO));
                returnUserAddress = oUserAddressDTO;
            }

            return returnUserAddress;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Converts this instance of <see cref="UserAddress"/> to an instance of <see cref="UserAddressDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="UserAddress"/> to convert.</param>
        public static UserAddressDTO ToDTO(this UserAddress entity)
        {
            if (entity == null) return null;

            var dto = new UserAddressDTO();

            dto.UserAddressID = entity.UserAddressID;
            dto.UserID = entity.UserID;
            dto.AddressID = entity.AddressID;
            dto.IsPrimary = entity.IsPrimary;

            entity.OnDTO(dto);

            return dto;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="UserAddressDTO"/> converted from <see cref="UserAddress"/>.</param>
 static partial void OnDTO(this UserAddress entity, UserAddressDTO dto);
Ejemplo n.º 4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="UserAddressDTO"/> converted from <see cref="UserAddress"/>.</param>
 static partial void OnDTO(this UserAddress entity, UserAddressDTO dto) {
     if (entity != null && entity.Address != null) dto.Address = AddressAssembler.ToDTO(entity.Address);
 }