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