Exemple #1
0
        /// <summary>
        /// Converts this instance of <see cref="AlarmLog"/> to an instance of <see cref="AlarmLogDto"/>.
        /// </summary>
        /// <param name="entity"><see cref="AlarmLog"/> to convert.</param>
        public static AlarmLogDto ToDTO(this AlarmLog entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new AlarmLogDto();

            dto.AlarmLogId     = entity.AlarmLogId;
            dto.AlarmLevelName = entity.AlarmLevelName;
            dto.Action         = entity.Action;
            dto.TimeStamp      = entity.TimeStamp;
            dto.VariableId     = entity.VariableId;
            dto.CurrentValue   = entity.CurrentValue;

            entity.OnDTO(dto);

            return(dto);
        }
Exemple #2
0
        /// <summary>
        /// Converts this instance of <see cref="AlarmLogDto"/> to an instance of <see cref="AlarmLog"/>.
        /// </summary>
        /// <param name="dto"><see cref="AlarmLogDto"/> to convert.</param>
        public static AlarmLog ToEntity(this AlarmLogDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new AlarmLog();

            entity.AlarmLogId     = dto.AlarmLogId;
            entity.AlarmLevelName = dto.AlarmLevelName;
            entity.Action         = dto.Action;
            entity.TimeStamp      = dto.TimeStamp;
            entity.VariableId     = dto.VariableId;
            entity.CurrentValue   = dto.CurrentValue;

            dto.OnEntity(entity);

            return(entity);
        }
Exemple #3
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="AlarmLog"/> converted from <see cref="AlarmLogDto"/>.</param>
 static partial void OnEntity(this AlarmLogDto dto, AlarmLog entity);
Exemple #4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="AlarmLogDto"/> converted from <see cref="AlarmLog"/>.</param>
 static partial void OnDTO(this AlarmLog entity, AlarmLogDto dto);