public ProjectDTO Create(ProjectDTO instance) { return Project.AddProject(instance.ToEntity()).ToDTO(); }
/// <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);
public ProjectDTO Update(string id, ProjectDTO instance) { instance.ProjectId = Int32.Parse(id); return Project.UpdateProject(Int32.Parse(id), instance).ToDTO(); }
/// <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; }