public void AddSuggestion(string title, string description) { SuggestionEntry entry = new SuggestionEntry { title = title, description = description, dateLogged = string.Format("logged on: {0}", DateTime.Now.ToString(new CultureInfo("en-GB"))) }; suggestionDB.list.Add(entry); }
// add suggestion to forward index int AddSuggestionEntry(string suggestion, out bool isNew) { int id; SuggestionEntry entry; isNew = !contentToSuggestion.TryGetValue(suggestion, out entry); if (isNew) { id = contentToSuggestion.Count; entry = new SuggestionEntry(id, suggestion, 1); contentToSuggestion[suggestion] = idToSuggestion[id] = entry; } else { entry.count++; } return(entry.id); }