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

            var dto = new ValueDTO();

            dto.Id        = entity.Id;
            dto.Parameter = entity.Parameter;
            dto.Key       = entity.Key;

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

            var entity = new Value();

            entity.Id        = dto.Id;
            entity.Parameter = dto.Parameter;
            entity.Key       = dto.Key;

            return(entity);
        }