/// <summary> /// Converts this instance of <see cref="NhaCungCap"/> to an instance of <see cref="NhaCungCapDTO"/>. /// </summary> /// <param name="entity"><see cref="NhaCungCap"/> to convert.</param> public static NhaCungCapDTO ToDTO(this NhaCungCap entity) { if (entity == null) { return(null); } var dto = new NhaCungCapDTO(); dto.MaNCC = entity.MaNCC; dto.TenNCC = entity.TenNCC; dto.SoDT = entity.SoDT; dto.DiaChi = entity.DiaChi; entity.OnDTO(dto); return(dto); }
/// <summary> /// Converts this instance of <see cref="NhaCungCapDTO"/> to an instance of <see cref="NhaCungCap"/>. /// </summary> /// <param name="dto"><see cref="NhaCungCapDTO"/> to convert.</param> public static NhaCungCap ToEntity(this NhaCungCapDTO dto) { if (dto == null) { return(null); } var entity = new NhaCungCap(); entity.MaNCC = dto.MaNCC; entity.TenNCC = dto.TenNCC; entity.SoDT = dto.SoDT; entity.DiaChi = dto.DiaChi; dto.OnEntity(entity); return(entity); }
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="NhaCungCap"/> converted from <see cref="NhaCungCapDTO"/>.</param> static partial void OnEntity(this NhaCungCapDTO dto, NhaCungCap entity);
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="NhaCungCapDTO"/> converted from <see cref="NhaCungCap"/>.</param> static partial void OnDTO(this NhaCungCap entity, NhaCungCapDTO dto);