Пример #1
0
 public DiagnosticLogDTO CreateDiagnosticLog(DiagnosticLogDTO instance)
 {
     return DiagnosticLog.AddDiagnosticLog(instance.ToEntity()).ToDTO();
 }
Пример #2
0
        /// <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);
Пример #3
0
 public DiagnosticLogDTO UpdateDiagnosticLog(string id, DiagnosticLogDTO instance)
 {
     return DiagnosticLog.UpdateDiagnosticLog(int.Parse(id),instance.ToEntity()).ToDTO();
 }
Пример #4
0
        /// <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;
        }