コード例 #1
0
ファイル: Controllers.cs プロジェクト: AdrianNoble/Ed-Fi-ODS
        private IEnumerable <StandardizedResourceProfileData> GetStandardizedResourceProfileData()
        {
            if (ProjectHasProfileDefinition)
            {
                return(ProfileResourceNamesProvider
                       .GetProfileResourceNames()
                       .Select(prn => prn.ProfileName)
                       .Distinct()
                       .Select(
                           profileName =>
                           ProfileResourceModelProvider.GetProfileResourceModel(profileName))
                       .SelectMany(
                           prm => prm.Resources.Select(
                               pct =>
                               new StandardizedResourceProfileData
                {
                    Readable = pct.Readable, Writable = pct.Writable, ProfileName = prm.ProfileName
                }))
                       .OrderBy(spd => spd.ProfileName.ToLower())
                       .ThenBy(x => x.ResolvedResource.Name));
            }

            return(ResourceModelProvider.GetResourceModel()
                   .GetAllResources()
                   .Where(r => !r.IsAbstract() && TemplateContext.ShouldRenderResourceClass(r))
                   .OrderBy(x => x.Name)
                   .Select(
                       resource =>
                       new StandardizedResourceProfileData
            {
                Readable = resource, Writable = resource, ProfileName = null
            })
                   .OrderBy(x => x.ResolvedResource.Name));
        }
コード例 #2
0
 private IEnumerable <ProfileResourceModel> GetProfileResourceModels()
 {
     return(ProfileResourceNamesProvider
            .GetProfileResourceNames()
            .Select(prn => prn.ProfileName)
            .Distinct()
            .Select(
                profileName =>
                ProfileResourceModelProvider.GetProfileResourceModel(profileName)));
 }