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

            var dto = new AlarmDto();

            dto.AlarmId         = entity.AlarmId;
            dto.Active          = entity.Active;
            dto.Acknowledged    = entity.Acknowledged;
            dto.AlarmLevelName  = entity.AlarmLevelName;
            dto.MaxValue        = entity.MaxValue;
            dto.SetTime         = entity.SetTime;
            dto.MaxValueTime    = entity.MaxValueTime;
            dto.DeactivatedTime = entity.DeactivatedTime;
            dto.SetPoint        = entity.SetPoint;
            dto.Priority        = entity.Priority;
            dto.VariableId      = entity.VariableId;

            entity.OnDTO(dto);

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

            var entity = new Alarm();

            entity.AlarmId         = dto.AlarmId;
            entity.Active          = dto.Active;
            entity.Acknowledged    = dto.Acknowledged;
            entity.AlarmLevelName  = dto.AlarmLevelName;
            entity.MaxValue        = dto.MaxValue;
            entity.SetTime         = dto.SetTime;
            entity.MaxValueTime    = dto.MaxValueTime;
            entity.DeactivatedTime = dto.DeactivatedTime;
            entity.SetPoint        = dto.SetPoint;
            entity.Priority        = dto.Priority;
            entity.VariableId      = dto.VariableId;

            dto.OnEntity(entity);

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