/// <summary> /// Create a new Defect with required attributes. /// </summary> /// <param name="name">The initial name of the entity.</param> /// <param name="project">The Project this Defect will be in.</param> /// <param name="attributes">Required attributes.</param> /// <returns></returns> public Defect Defect(string name, Project project, IDictionary<string, object> attributes) { var defect = new Defect(instance) { Name = name, Project = project }; AddAttributes(defect, attributes); defect.Save(); return defect; }
/// <summary> /// Index a defect /// </summary> /// <param name="defect">defect to index</param> private void Index(Defect defect) { Document doc = IndexCommonFields(defect); if (null != defect.Type) doc.Add(UnStored("Type", defect.Type.CurrentValue)); doc.Add(UnStored("Environment", defect.Environment)); doc.Add(UnStored("FixedInBuild", defect.ResolvedInBuild)); doc.Add(UnStored("FoundBy", defect.FoundBy)); doc.Add(UnStored("FoundInBuild", defect.FoundInBuild)); doc.Add(UnStored("FoundInVersion", defect.FoundInVersion)); doc.Add(UnStored("ResolutionDetails", defect.ResolutionDetails)); doc.Add(UnStored("ResolutionReason", defect.ResolutionReason.CurrentValue)); doc.Add(UnStored("ResolvedInBuild", defect.ResolvedInBuild)); if(null != defect.VerifiedBy) doc.Add(UnStored("VerifiedBy", defect.VerifiedBy.Name)); _luceneIndexWriter.AddDocument(doc); }