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

            var dto = new JobDTO();

            dto.Id       = entity.Id;
            dto.JobId    = entity.JobId;
            dto.JobItems = entity.JobItems.ToDTOs();

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

            var entity = new Job();

            entity.Id       = dto.Id;
            entity.JobId    = dto.JobId;
            entity.JobItems = dto.JobItems.ToEntities();

            return(entity);
        }