public DiagnosticLogDTO CreateDiagnosticLog(DiagnosticLogDTO instance) { return DiagnosticLog.AddDiagnosticLog(instance.ToEntity()).ToDTO(); }
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="DiagnosticLogDTO"/> converted from <see cref="DiagnosticLog"/>.</param> partial static void OnDTO(this DiagnosticLog entity, DiagnosticLogDTO dto);
public DiagnosticLogDTO UpdateDiagnosticLog(string id, DiagnosticLogDTO instance) { return DiagnosticLog.UpdateDiagnosticLog(int.Parse(id),instance.ToEntity()).ToDTO(); }
/// <summary> /// Converts this instance of <see cref="DiagnosticLog"/> to an instance of <see cref="DiagnosticLogDTO"/>. /// </summary> /// <param name="entity"><see cref="DiagnosticLog"/> to convert.</param> public static DiagnosticLogDTO ToDTO(this DiagnosticLog entity) { if (entity == null) return null; var dto = new DiagnosticLogDTO(); dto.LogId = entity.LogId; if (entity.LogType != null) { dto.LogType = entity.LogType.Value; } dto.Message = entity.Message; dto.Component = entity.Component; if (entity.CreateTime != null) { dto.CreateTime = entity.CreateTime.Value; } entity.OnDTO(dto); return dto; }