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

            var entity = new SoChiTieuCuaHang();

            entity.MaCT     = dto.MaCT;
            entity.LyDoChi  = dto.LyDoChi;
            entity.NgayGio  = dto.NgayGio;
            entity.TongTien = dto.TongTien;

            dto.OnEntity(entity);

            return(entity);
        }