예제 #1
0
파일: Core.DTO.cs 프로젝트: wangn6/rep2
        /// <summary>
        /// Invoked when <see cref="ToDTO"/> operation is about to return.
        /// </summary>
        /// <param name="dto"><see cref="TestEnvironmentDTO"/> converted from <see cref="TestEnvironment"/>.</param>
partial         static void OnDTO(this TestEnvironment entity, TestEnvironmentDTO dto);
예제 #2
0
파일: Core.DTO.cs 프로젝트: wangn6/rep2
        /// <summary>
        /// Converts this instance of <see cref="TestEnvironment"/> to an instance of <see cref="TestEnvironmentDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="TestEnvironment"/> to convert.</param>
        public static TestEnvironmentDTO ToDTO(this TestEnvironment entity)
        {
            if (entity == null) return null;

            var dto = new TestEnvironmentDTO();

            dto.EnvironmentId = entity.EnvironmentId;
            dto.ProviderId = entity.ProviderId;
            dto.Name = entity.Name;
            dto.Type = entity.Type;
            dto.Status = entity.Status;
            dto.CreateDate = entity.CreateDate;
            dto.ModifyDate = entity.ModifyDate;
            dto.Config = entity.Config;
            dto.Description = entity.Description;

            entity.OnDTO(dto);

            return dto;
        }