예제 #1
0
 public ProjectDTO Create(ProjectDTO instance)
 {
     return Project.AddProject(instance.ToEntity()).ToDTO();
 }
예제 #2
0
파일: Core.DTO.cs 프로젝트: wangn6/rep2
        /// <summary>
        /// Invoked when <see cref="ToDTO"/> operation is about to return.
        /// </summary>
        /// <param name="dto"><see cref="ProductDTO"/> converted from <see cref="Product"/>.</param>
partial         static void OnDTO(this Project entity, ProjectDTO dto);
예제 #3
0
 public ProjectDTO Update(string id, ProjectDTO instance)
 {
     instance.ProjectId = Int32.Parse(id);
     return Project.UpdateProject(Int32.Parse(id), instance).ToDTO();
 }
예제 #4
0
파일: Core.DTO.cs 프로젝트: wangn6/rep2
        /// <summary>
        /// Converts this instance of <see cref="Product"/> to an instance of <see cref="ProductDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="Product"/> to convert.</param>
        public static ProjectDTO ToDTO(this Project entity)
        {
            if (entity == null) return null;

            var dto = new ProjectDTO();

            dto.ProjectId = entity.ProjectId;
            dto.Name = entity.Name;
            dto.Description = entity.Description;
            if (entity.VCSType != null)
            {
                dto.VCSType = entity.VCSType.Value;
            }
            dto.VCSServer = entity.VCSServer;
            dto.VCSUser = entity.VCSUser;
            dto.VCSPassword = entity.VCSPassword;
            dto.VCSRootPath = entity.VCSRootPath;
            dto.RunTime = entity.RunTime;

            entity.OnDTO(dto);

            return dto;
        }