Example #1
0
 public static DiagnosticLog AddDiagnosticLog(DiagnosticLog log)
 {
     using (ES1AutomationEntities context = new ES1AutomationEntities())
     {
         context.DiagnosticLogs.Add(log);
         context.SaveChanges();
         return log;
     }
 }
Example #2
0
        /// <summary>
        /// Invoked when <see cref="ToEntity"/> operation is about to return.
        /// </summary>
        /// <param name="entity"><see cref="DiagnosticLog"/> converted from <see cref="DiagnosticLogDTO"/>.</param>
partial         static void OnEntity(this DiagnosticLogDTO dto, DiagnosticLog entity);
Example #3
0
        /// <summary>
        /// Converts this instance of <see cref="DiagnosticLogDTO"/> to an instance of <see cref="DiagnosticLog"/>.
        /// </summary>
        /// <param name="dto"><see cref="DiagnosticLogDTO"/> to convert.</param>
        public static DiagnosticLog ToEntity(this DiagnosticLogDTO dto)
        {
            if (dto == null) return null;

            var entity = new DiagnosticLog();

            entity.LogId = dto.LogId;
            entity.LogType = dto.LogType;
            entity.Component = dto.Component;
            entity.Message = dto.Message;
            entity.CreateTime = dto.CreateTime;

            dto.OnEntity(entity);

            return entity;
        }