//public Enumeration CredentialStatusType { get; set; } public List <CodeItem> GetVocabularyItems(string categorySchema, bool includeEmpty = false) { if (categorySchema == "ceterms:AgentServiceType") { return(AgentServiceTypes.Items.ConvertAll(m => new CodeItem() { Id = m.Id, SchemaName = m.SchemaName, Totals = m.Totals, Name = m.Name, Description = m.Description, CategoryId = m.ParentId, Code = m.CodeId.ToString() }).Where(m => m.Totals > (includeEmpty ? -1 : 0)).ToList()); } else { return(PropertiesTotals.Where(m => m.CategorySchema == categorySchema && m.Totals > (includeEmpty ? -1 : 0)).ToList()); } }
public Statistic GetSingleStatistic(string schemaName, string idPrefix, List <string> tags, bool allowSearchability, string title = "", string description = "", bool includeEmpty = false, int overrideSortOrder = -1) { if (schemaName == "frameworkReport:Competencies") { } else if (schemaName == "frameworkReport:PathwayComponents") { } var m = PropertiesTotals.Concat(PropertiesTotalsByEntity).FirstOrDefault(x => x.SchemaName == schemaName.Trim() && x.Totals > (includeEmpty ? -1 : 0)); if (m == null) { return(new Statistic()); } else { return(new Statistic( string.IsNullOrWhiteSpace(title) ? m.Name : title, string.IsNullOrWhiteSpace(description) ? m.Description : description, m.Totals, idPrefix + "_" + (m.SchemaName ?? "").Replace(":", "_"), tags, m.CategoryId.ToString(), overrideSortOrder > -1 ? overrideSortOrder : m.SortOrder, m.Id.ToString(), allowSearchability )); } //return ( PropertiesTotals.Concat( PropertiesTotalsByEntity ) ).Where( m => m.SchemaName == schemaName && m.Totals > ( includeEmpty ? -1 : 0 ) ).ToList() // .ConvertAll( m => new Statistic( // string.IsNullOrWhiteSpace( title ) ? m.Name : title, // string.IsNullOrWhiteSpace( description ) ? m.Description : description, // m.Totals, // idPrefix + "_" + ( m.SchemaName ?? "" ).Replace( ":", "_" ), // tags, // m.CategoryId.ToString(), // m.SortOrder, // m.Id.ToString(), // allowSearchability // ) ) // .FirstOrDefault() ?? new Statistic(); // return single; }