private IEnumerable <CommenceCategoryMetaData> GetCategoryMetadata(IEnumerable <string> list) { foreach (string categoryName in list) { ICategoryDef d = _db.GetCategoryDefinition(categoryName); CommenceCategoryMetaData c = new CommenceCategoryMetaData(categoryName, d); var fields = _db.GetFieldNames(categoryName); c.Fields = GetFieldMetaData(categoryName, fields).ToList(); c.Connections = _db.GetConnectionNames(categoryName).Cast <CommenceConnection>().ToList(); var views = _db.GetViewNames(categoryName); c.Views = GetViewMetaData(views).ToList(); var forms = _db.GetFormNames(categoryName); c.Forms = GetFormMetaData(categoryName, forms).ToList(); c.Items = _db.GetItemCount(categoryName); yield return(c); } }