예제 #1
0
 public static DiagnosticLog AddDiagnosticLog(DiagnosticLog log)
 {
     using (ES1AutomationEntities context = new ES1AutomationEntities())
     {
         context.DiagnosticLogs.Add(log);
         context.SaveChanges();
         return log;
     }
 }
예제 #2
0
파일: Core.DTO.cs 프로젝트: wangn6/rep2
        /// <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);
예제 #3
0
파일: Core.DTO.cs 프로젝트: wangn6/rep2
        /// <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;
        }