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

            var dto = new VariableDto();

            dto.VariableId         = entity.VariableId;
            dto.Name               = entity.Name;
            dto.Type               = entity.Type;
            dto.DataLoggingEnabled = entity.DataLoggingEnabled;

            entity.OnDTO(dto);

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

            var entity = new Variable();

            entity.VariableId         = dto.VariableId;
            entity.Name               = dto.Name;
            entity.Type               = dto.Type;
            entity.DataLoggingEnabled = dto.DataLoggingEnabled;

            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="Variable"/> converted from <see cref="VariableDto"/>.</param>
 static partial void OnEntity(this VariableDto dto, Variable entity);
Exemple #4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="VariableDto"/> converted from <see cref="Variable"/>.</param>
 static partial void OnDTO(this Variable entity, VariableDto dto);