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