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

            var dto = new LoaiSPDTO();

            dto.MaLoai  = entity.MaLoai;
            dto.TenLoai = entity.TenLoai;

            entity.OnDTO(dto);

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

            var entity = new LoaiSP();

            entity.MaLoai  = dto.MaLoai;
            entity.TenLoai = dto.TenLoai;

            dto.OnEntity(entity);

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