public void RemoveResults(ObjectId resultsid, ObjectId userid) { HtmlResults htmlResults = results[resultsid]; htmlResults.RemoveResultsOwner(userid); if (htmlResults.owners.Count == 0) { results.Remove(resultsid); } }
public IHtmlResults AddResults(string htmlTags, ObjectId userid) { IEnumerable <IHtmlResults> existingResults = results.Values.Where(val => val.htmlTags == htmlTags); if (existingResults.Count() == 0) { HtmlResults newResults = new HtmlResults(htmlTags); newResults.AddResultsOwner(userid); results.Add(newResults.resultsid, newResults); return(newResults as IHtmlResults); } else if (existingResults.Count() == 1) { existingResults.First().AddResultsOwner(userid); return(existingResults.First()); } else { throw new Exception(); } }