private ICategoryDef GetCategoryDefinition(string categoryName) { if (string.IsNullOrEmpty(categoryName)) { return(null); } using (ICommenceDatabase db = new CommenceDatabase()) { return(db.GetCategoryDefinition(categoryName)); } }
private IEnumerable <object> GetCategories() { using (ICommenceDatabase db = new CommenceDatabase()) { var categories = db.GetCategoryNames(); foreach (string c in categories) { ICategoryDef def = db.GetCategoryDefinition(c); yield return(new { CategoryName = c, Id = def.CategoryID, Clarified = def.Clarified, ClarifyField = def.ClarifyField, ClarifySeparator = def.ClarifySeparator, Duplicates = def.Duplicates, MaxItems = def.MaxItems, Shared = def.Shared }); } } }