/// <summary> /// Gets a list of all projects without workflowelementcategories. /// </summary> /// <returns></returns> public IEnumerable <ProjectModel> Get() { var list = ProjectsCollection.Find(EmptyProjectFilter).ToList(); // Parallel so requests will be faster. Parallel.ForEach(list, project => { project.WorkflowElementCategories = null; }); return(list); }
public ProjectModel Post(ProjectModel model) { var template = ProjectsCollection.Find(TemplateProjectFilter).FirstOrDefault(); foreach (WorkflowElementCategory category in template.WorkflowElementCategories.ToList()) { category.WorkflowElements.RemoveAll(x => x.ASVSLevel > model.ASVSLevel); if (category.WorkflowElements.Count <= 0) { template.WorkflowElementCategories.Remove(category); } } model.WorkflowElementCategories = template.WorkflowElementCategories; ProjectsCollection.InsertOne(model); return(model); }
private bool IsEmpty() { var list = ProjectsCollection.Find(EmptyProjectFilter).ToList(); return(list.Any()); }