Esempio n. 1
0
        /// <summary>
        /// Converts this instance of <see cref="GiaBan"/> to an instance of <see cref="GiaBanDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="GiaBan"/> to convert.</param>
        public static GiaBanDTO ToDTO(this GiaBan entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new GiaBanDTO();

            dto.MaGia = entity.MaGia;
            dto.MaKH  = entity.MaKH;
            dto.MaSP  = entity.MaSP;
            dto.Gia   = entity.Gia;

            entity.OnDTO(dto);

            return(dto);
        }
Esempio n. 2
0
        /// <summary>
        /// Converts this instance of <see cref="GiaBanDTO"/> to an instance of <see cref="GiaBan"/>.
        /// </summary>
        /// <param name="dto"><see cref="GiaBanDTO"/> to convert.</param>
        public static GiaBan ToEntity(this GiaBanDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new GiaBan();

            entity.MaGia = dto.MaGia;
            entity.MaKH  = dto.MaKH;
            entity.MaSP  = dto.MaSP;
            entity.Gia   = dto.Gia;

            dto.OnEntity(entity);

            return(entity);
        }
Esempio n. 3
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="GiaBan"/> converted from <see cref="GiaBanDTO"/>.</param>
 static partial void OnEntity(this GiaBanDTO dto, GiaBan entity);
Esempio n. 4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="GiaBanDTO"/> converted from <see cref="GiaBan"/>.</param>
 static partial void OnDTO(this GiaBan entity, GiaBanDTO dto);