Exemplo n.º 1
0
 private object GetTemplateModelFromResourceModel()
 {
     return(new
     {
         ConditionalInclude = string.Empty, RenderGroups = new object[]
         {
             new
             {
                 Resources = ResourceModelProvider.GetResourceModel()
                             .GetAllResources()
                             .Where(
                     resource
                     => !resource.IsAbstract() &&
                     TemplateContext
                     .ShouldRenderResourceClass(
                         resource))
                             .Select(
                     resource =>
                     GetTemplateModelPropertiesForResource(
                         GetNamespace(
                             resource),
                         resource,
                         GetResourceClassTypeName(
                             resource),
                         true,
                         true,
                         false))
             }
         }
     });
 }
            protected override void Act()
            {
                _actualDefinitions = SwaggerDocumentFactoryHelper
                                     .CreateSwaggerDefinitionsFactory(
                    new SwaggerDocumentContext(ResourceModelProvider.GetResourceModel())
                {
                    RenderType = RenderType.GeneralizedExtensions
                }).Create(_resources.Select(r => new SwaggerResource(r)).ToList());

                _actualEdfiResourceDefinitions = _resources.Where(r => r.IsEdFiStandardResource).Select(r => r.Name.ToCamelCase())
                                                 .Where(_actualDefinitions.ContainsKey).Select(r => _actualDefinitions[r]).ToList();

                // link definitions are excluded here and tested in a separate assertion.
                _actualExtendableEdfiResourceDefinitions = _resources.Where(r => r.IsEdFiStandardResource && !r.Entity.IsLookup)
                                                           .Select(r => r.Name.ToCamelCase()).Where(_actualDefinitions.ContainsKey).Select(r => _actualDefinitions[r])
                                                           .ToList();

                _actualPropertyNamesByDefinitionName = _actualDefinitions.Where(d => d.Key != "link").Select(
                    d => new
                {
                    DefinitionName =
                        d.Key,

                    // Separate tests verify that these properties must exist in resource definitions
                    Properties = d.Value.properties.Keys.Except(
                        new[]
                    {
                        "_ext",
                        "_etag",
                        "link"
                    }).ToList()
                }).ToDictionary(k => k.DefinitionName, v => v.Properties);
            }
Exemplo n.º 3
0
        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));
        }
            protected override void Arrange()
            {
                _compositesMetadataProvider = Stub <ICompositesMetadataProvider>();

                A.CallTo(() => _compositesMetadataProvider.GetAllCategories())
                .Returns(new List <CompositeCategory>());

                _profileResourceNamesProvider = new ProfileResourceNamesProvider();

                _profileResourceModelProvider = new ProfileResourceModelProvider(
                    ResourceModelProvider, new ProfileResourceNamesProvider());

                var _openAPIMetadataRouteInformation = Stub <List <IOpenApiMetadataRouteInformation> >();
                var _openApiContentProviders         = Stub <List <IOpenApiContentProvider> >();

                var openApiMetadataRouteInformation = new List <IOpenApiMetadataRouteInformation>();

                var defaultPageSizeLimitProvider = new DefaultPageSizeLimitProvider(GetConfiguration());

                var openApiMetadataDocumentFactory = new OpenApiMetadataDocumentFactory(CreateApiSettings(), defaultPageSizeLimitProvider);

                var resourceModelProvider = Stub <IResourceModelProvider>();

                var resourceModel = ResourceModelProvider.GetResourceModel();

                A.CallTo(() => resourceModelProvider.GetResourceModel()).Returns(resourceModel);

                _openApiMetadataCacheProvider = new OpenApiMetadataCacheProvider(
                    resourceModelProvider, GetTestRouteInformation(CreateApiSettings()).ToList(), TestOpenApiContentProviders, openApiMetadataDocumentFactory);
            }
Exemplo n.º 5
0
        private object FormatReadExpressions(
            StandardizedResourceProfileData resourceData,
            Func <Resource, IEnumerable <ResourceProperty> > resourcePropertiesToRender)
        {
            if (resourceData.Readable == null)
            {
                return(new { HasProperties = false });
            }

            //For matching purposes
            var unfilteredResource = ResourceModelProvider.GetResourceModel()
                                     .GetResourceByFullName(resourceData.Readable.Entity.FullName);

            //otherwise resourceData.Readable
            return(new
            {
                HasProperties = true,
                Properties = resourcePropertiesToRender.Invoke(unfilteredResource)
                             .OrderBy(x => x.EntityProperty.PropertyName)
                             .Select(
                    y => new
                {
                    SpecificationProperty = y.PropertyName,
                    RequestProperty = y.PropertyName
                })
            });
        }
 private object GetTemplateModelFromResourceModel()
 {
     return(new
     {
         RenderGroups = new object[]
         {
             new
             {
                 Namespace = GetNamespace(), Resources = ResourceModelProvider
                                                         .GetResourceModel()
                                                         .GetAllResources()
                                                         .Where(
                     resource => !resource.IsAbstract() &&
                     TemplateContext.ShouldRenderResourceClass(
                         resource))
                                                         .Select(
                     resource => new
                 {
                     ResourceName = resource.Name,
                     ResourceTypeName =
                         NamespaceHelper.GetRelativeNamespace(
                             GetNamespace(),
                             GetResourceTypeName(resource)),
                     EntityTypeName =
                         NamespaceHelper.GetRelativeNamespace(
                             GetNamespace(),
                             GetEntityTypeName(resource))
                 })
             }
         }
     });
 }
            protected override void Arrange()
            {
                _resources = ResourceModelProvider.GetResourceModel().GetAllResources().ToList();
                _expectedPropertyNamesByDefinitionName = ExpectedPropertyNamesByDefinitionName(_resources);
                _namingStrategy = new SwaggerDefinitionsFactoryDefaultNamingStrategy();

                _expectedDefinitionNames = _resources
                                           .Select(x => _namingStrategy.GetResourceName(x, new SwaggerResource(x)).ToCamelCase()).ToList();
            }
            protected override void Arrange()
            {
                _swaggerDocumentContext =
                    new SwaggerDocumentContext(
                        ResourceModelProvider.GetResourceModel())
                {
                    ProfileContext = new SwaggerProfileContext
                    {
                        ProfileName = "Test-ParentNonAbstractBaseClass-ExcludeOnly"
                    },
                    RenderType = RenderType.GeneralizedExtensions
                };

                string profileDefinition = @"<Profile name='Test-ParentNonAbstractBaseClass-ExcludeOnly'>
                                                <Resource name='StudentSpecialEducationProgramAssociation'>
                                                  <ReadContentType memberSelection='ExcludeOnly'>
                                                    <Property name='SpecialEducationHoursPerWeek'/>
                                                  </ReadContentType>
                                                  <WriteContentType memberSelection='IncludeAll'/>
                                                </Resource>
                                                <Resource name='StudentProgramAssociation'>
                                                  <ReadContentType memberSelection='IncludeOnly'/>
                                                </Resource>
                                              </Profile>";

                var profileResourceModel =
                    new ProfileResourceModel(
                        ResourceModelProvider.GetResourceModel(),
                        XElement.Parse(profileDefinition));

                var readableResourceModel =
                    profileResourceModel.ResourceByName.Values.Where(r => r.Readable != null);

                var writableResourceModel =
                    profileResourceModel.ResourceByName.Values.Where(r => r.Writable != null);

                _swaggerResources = readableResourceModel
                                    .Select(
                    r => new SwaggerResource(r.Readable)
                {
                    Name =
                        $"{CompositeTermInflector.MakeSingular(r.Readable.Name)}_{ContentTypeUsage.Readable}"
                        .ToCamelCase(),
                    Readable = true, IsProfileResource = true
                })
                                    .Concat(
                    writableResourceModel.Select(
                        r => new SwaggerResource(r.Writable)
                {
                    Name =
                        $"{CompositeTermInflector.MakeSingular(r.Writable.Name)}_{ContentTypeUsage.Writable}"
                        .ToCamelCase(),
                    Writable = true, IsProfileResource = true
                }
                        ))
                                    .ToList();
            }
        protected override void Configure()
        {
            _resourceModel = ResourceModelProvider.GetResourceModel();

            _resourcesToRender = ResourceModelProvider.GetResourceModel()
                                 .GetAllResources()
                                 .Where(r => TemplateContext.ShouldRenderResourceClass(r));

            _authorizationPropertiesByResource = InitializeAuthorizationPropertiesByResource();
        }
Exemplo n.º 10
0
            protected override void Arrange()
            {
                _expectedResources = ResourceModelProvider.GetResourceModel()
                                     .GetAllResources()
                                     .Where(x => !x.IsDescriptorEntity() && !x.IsAbstract())
                                     .Select(x => x.Name)
                                     .ToArray();

                _openApiMetadataUiResourceOnlyStrategy = new OpenApiMetadataUiResourceOnlyStrategy();
            }
Exemplo n.º 11
0
            protected override void Arrange()
            {
                _expectedDescriptors = ResourceModelProvider.GetResourceModel()
                                       .GetAllResources()
                                       .Where(x => x.IsDescriptorEntity())
                                       .Select(x => x.Name)
                                       .ToArray();

                _swaggerUiDescriptorOnlyStrategy = new SwaggerUiDescriptorOnlyStrategy();
            }
            protected override void Act()
            {
                var openApiMetadataResources = ResourceModelProvider.GetResourceModel()
                                               .GetAllResources()
                                               .Select(r => new OpenApiMetadataResource(r))
                                               .ToList();

                _actualPaths = OpenApiMetadataDocumentFactoryHelper.CreateOpenApiMetadataPathsFactory(
                    DomainModelDefinitionsProviderHelper.DefaultopenApiMetadataDocumentContext, CreateApiSettings())
                               .Create(openApiMetadataResources, false);
            }
            protected override void Act()
            {
                var swaggerResources = ResourceModelProvider.GetResourceModel()
                                       .GetAllResources()
                                       .Select(r => new SwaggerResource(r))
                                       .ToList();

                _actualPaths = SwaggerDocumentFactoryHelper.CreateSwaggerPathsFactory(
                    DomainModelDefinitionsProviderHelper.DefaultSwaggerDocumentContext)
                               .Create(swaggerResources);
            }
Exemplo n.º 14
0
            protected override void Act()
            {
                var openApiMetadataResources = ResourceModelProvider.GetResourceModel()
                                               .GetAllResources()
                                               .Select(r => new OpenApiMetadataResource(r))
                                               .ToList();

                _actualTags = OpenApiMetadataDocumentFactoryHelper.CreateOpenApiMetadataTagsFactory(
                    DomainModelDefinitionsProviderHelper.DefaultopenApiMetadataDocumentContext)
                              .Create(openApiMetadataResources);

                _actualTagNames = _actualTags.Select(x => x.name)
                                  .ToArray();
            }
Exemplo n.º 15
0
        protected override object Build()
        {
            var resources = ResourceModelProvider.GetResourceModel()
                            .GetAllResources();

            var aggregates = resources
                             .Select(
                r => new
            {
                ResourceName = r.Name, ResourceClasses =

                    // Add the root resource class (if it's not abstract or it has a composite id)
                    (r.Entity?.IsAbstractRequiringNoCompositeId() != true && TemplateContext.ShouldRenderResourceClass(r)
                                                  ? new ResourceClassBase[]
                {
                    r
                }
                                                  : new ResourceClassBase[0])

                    // Add in non-inherited child items
                    .Concat(
                        r.AllContainedItemTypes
                        .Where(
                            t => TemplateContext.ShouldRenderResourceClass(t) &&
                            !t.IsInheritedChildItem))
                    .ToList()
            })
                             .Where(x => x.ResourceClasses.Any())
                             .OrderBy(x => x.ResourceName)
                             .Select(
                x => new
            {
                AggregateName = x.ResourceName, Mappers = x.ResourceClasses
                                                          .OrderBy(y => y.Name)
                                                          .Select(BuildMapper)
            });

            var hasDerivedResources = resources.Any(r => r.IsDerived);

            return(new
            {
                HasDerivedResources = hasDerivedResources, NamespaceName =
                    EdFiConventions.BuildNamespace(
                        Namespaces.Entities.Common.BaseNamespace,
                        TemplateContext.SchemaProperCaseName),
                Aggregates = aggregates
            });
        }
Exemplo n.º 16
0
 private object GetTemplateModelFromProfileResourceModel()
 {
     return(new
     {
         ConditionalInclude = GetConditionalInclude(), RenderGroups = GetProfileResourceModels()
                                                                      .Select(
             model => new
         {
             Resources = model.ResourceByName.OrderBy(resource => resource.Key)
                         .Where(
                 resource => !model.GetResourceByName(resource.Key)
                 .IsAbstract())
                         .Select(
                 resource =>
                 GetTemplateModelPropertiesForResource(
                     GetNamespace(model.GetResourceByName(resource.Key), model.ProfileName),
                     ResourceModelProvider.GetResourceModel()
                     .GetResourceByFullName(resource.Key),
                     GetResourceClassTypeName(
                         model.GetResourceByName(resource.Key),
                         model.ProfileName),
                     model.ResourceIsReadable(resource.Key),
                     model.ResourceIsWritable(resource.Key) ||
                     model.ResourceByName
                     .Any(
                         r => r.Value.Writable != null &&
                         r.Value.Writable.Entity.IncomingAssociations
                         .Any(
                             a => a.OtherEntity.FullName == resource.Key &&
                             a.AssociationType
                             == AssociationViewType.FromBase)),
                     model.ResourceIsWritable(resource.Key) ||
                     model.ResourceByName
                     .Any(
                         r => r.Value.Writable != null &&
                         r.Value.Writable.Entity.IncomingAssociations
                         .Any(
                             a => a.OtherEntity.FullName == resource.Key &&
                             a.AssociationType
                             == AssociationViewType.FromBase)),
                     GetProfileContentWritableFormat(resource.Key.Name, model.ProfileName)
                     ))
         })
     });
 }
            protected override void Arrange()
            {
                _schemaNameMapProvider =
                    new SchemaNameMapProvider(
                        DomainModelProvider.GetDomainModel()
                        .Schemas);

                var apiSettings = CreateApiSettings();

                AssemblyLoader.EnsureLoaded <Marker_EdFi_Ods_Composites_Test>();

                var openApiMetadataRouteInformation = new List <IOpenApiMetadataRouteInformation>();

                var _resourceModelProvider = Stub <IResourceModelProvider>();

                var resourceModel = ResourceModelProvider.GetResourceModel();

                A.CallTo(() => _resourceModelProvider.GetResourceModel()).Returns(resourceModel);

                var openapicontentproviderlist = new List <IOpenApiContentProvider>();

                var compositemetadataprovider = new CompositesMetadataProvider();

                var defaultPageSieLimitProvider = new DefaultPageSizeLimitProvider(GetConfiguration());

                var openApiMetadataDocumentFactory = new OpenApiMetadataDocumentFactory(apiSettings, defaultPageSieLimitProvider);

                var compositeOpenApiContentProvider = new CompositesOpenApiContentProvider(
                    compositemetadataprovider, ResourceModelProvider, openApiMetadataDocumentFactory);

                var extensionsOpenApiContentProvider = new ExtensionsOpenApiContentProvider(
                    DomainModelProvider, ResourceModelProvider, SchemaNameMapProvider, openApiMetadataDocumentFactory);

                var identityprovider = new IdentityOpenApiContentProvider();

                openapicontentproviderlist.Add(identityprovider);

                openapicontentproviderlist.Add(compositeOpenApiContentProvider);

                openapicontentproviderlist.Add(extensionsOpenApiContentProvider);

                _openApiMetadataCacheProvider = new OpenApiMetadataCacheProvider(
                    ResourceModelProvider, GetTestRouteInformation(apiSettings).ToList(), openapicontentproviderlist, openApiMetadataDocumentFactory);
            }
            protected override void Arrange()
            {
                var _openAPIMetadataRouteInformation = Stub <IList <IOpenApiMetadataRouteInformation> >();

                var _openApiContentProviders = Stub <IList <IOpenApiContentProvider> >();

                var defaultPageSieLimitProvider = new DefaultPageSizeLimitProvider(GetConfiguration());

                var openApiMetadataDocumentFactory = new OpenApiMetadataDocumentFactory(CreateApiSettings(), defaultPageSieLimitProvider);

                var resourceModelProvider = Stub <IResourceModelProvider>();

                var resourcemodeldata = ResourceModelProvider.GetResourceModel();

                A.CallTo(() => resourceModelProvider.GetResourceModel()).Returns(resourcemodeldata);

                _openApiMetadataCacheProvider = new OpenApiMetadataCacheProvider(
                    resourceModelProvider, _openAPIMetadataRouteInformation, _openApiContentProviders, openApiMetadataDocumentFactory);
            }
            protected override void Arrange()
            {
                _openApiMetadataDocumentContext = new OpenApiMetadataDocumentContext(ResourceModelProvider.GetResourceModel())
                {
                    CompositeContext = new OpenApiMetadataCompositeContext {CategoryName = OpenApiCompositeHelper.CategoryName}
                };

                var definitions = new List<XElement>(OpenApiCompositeHelper.CompositeDefinitions).ToReadOnlyList();
                var routes = new List<XElement>(OpenApiCompositeHelper.Routes).ToReadOnlyList();
                var compositesMetadataProvider = Stub<ICompositesMetadataProvider>();

                A.CallTo(() => compositesMetadataProvider.TryGetCompositeDefinitions(A<string>._, A<string>._, out definitions))
                    .Returns(true);

                A.CallTo(() => compositesMetadataProvider.TryGetRoutes(A<string>._, A<string>._, out routes)).Returns(true);

                _openApiMetadataResources = new OpenApiCompositeStrategy(compositesMetadataProvider)
                    .GetFilteredResources(_openApiMetadataDocumentContext).ToList();
            }
            protected override void Arrange()
            {
                _openApiMetadataDocumentContext =
                    new OpenApiMetadataDocumentContext(ResourceModelProvider.GetResourceModel())
                    {
                        ProfileContext = new OpenApiMetadataProfileContext()
                    };

                string profileDefinition =
                    @"<Profile name='Test-ParentNonAbstractBaseClass-ExcludeOnly'> <Resource name='StudentSpecialEducationProgramAssociation'> <ReadContentType memberSelection='ExcludeOnly'> <Property name='SpecialEducationHoursPerWeek'/> </ReadContentType> <WriteContentType memberSelection='IncludeAll'/> </Resource> <Resource name='Staff'> <ReadContentType memberSelection='IncludeOnly'> <Extension name='GrandBend'  memberSelection='IncludeOnly' logicalSchema='GrandBend'> <Property name='Tenured'/> </Extension> </ReadContentType> <WriteContentType memberSelection='IncludeAll' /> </Resource> <Resource name='StudentProgramAssociation'> <ReadContentType memberSelection='IncludeOnly'/> </Resource> </Profile>";

                var profileResourceModel = new ProfileResourceModel(
                    ResourceModelProvider.GetResourceModel(), XElement.Parse(profileDefinition));

                var readableResourceModel = profileResourceModel.ResourceByName.Values.Where(r => r.Readable != null);
                var writableResourceModel = profileResourceModel.ResourceByName.Values.Where(r => r.Writable != null);
                var edFiSchemaPrefix = "edFi";

                _openApiMetadataResources = readableResourceModel
                    .Select(
                        r => new OpenApiMetadataResource(r.Readable)
                        {
                            Name =
                                $"{edFiSchemaPrefix}_{CompositeTermInflector.MakeSingular(r.Readable.Name)}_{ContentTypeUsage.Readable}"
                                    .ToCamelCase(),
                            Readable = true,
                            IsProfileResource = true
                        }).Concat(
                        writableResourceModel.Select(
                            r => new OpenApiMetadataResource(r.Writable)
                            {
                                Name =
                                    $"{edFiSchemaPrefix}_{CompositeTermInflector.MakeSingular(r.Writable.Name)}_{ContentTypeUsage.Writable}"
                                        .ToCamelCase(),
                                Writable = true,
                                IsProfileResource = true
                            })).ToList();
            }
Exemplo n.º 21
0
        protected override object Build()
        {
            var resourceClassesToRender = ResourceModelProvider.GetResourceModel()
                                          .GetAllResources()
                                          .SelectMany(
                r => r.AllContainedItemTypesOrSelf.Where(
                    i => TemplateContext.ShouldRenderResourceClass(i)

                    // Don't render artifacts for base class children in the context of derived resources
                    && !i.IsInheritedChildItem()))
                                          .OrderBy(r => r.Name)
                                          .ToList();

            var entityInterfacesModel = new
            {
                EntitiesBaseNamespace =
                    EdFiConventions.BuildNamespace(
                        Namespaces.Entities.Common.BaseNamespace,
                        TemplateContext.SchemaProperCaseName),
                Interfaces = resourceClassesToRender
                             .Where(TemplateContext.ShouldRenderResourceClass)
                             .Select(
                    r => new
                {
                    r.FullName.Schema,
                    r.Name,
                    AggregateName         = r.Name,
                    ImplementedInterfaces = GetImplementedInterfaceString(r),
                    ParentInterfaceName   = GetParentInterfaceName(r),
                    ParentClassName       = GetParentClassName(r),
                    IdentifyingProperties = r
                                            .IdentifyingProperties

                                            // Exclude inherited identifying properties where the property has not been renamed
                                            .Where(
                        p => !(
                            p.EntityProperty
                            ?.IsInheritedIdentifying ==
                            true &&
                            !p
                            .EntityProperty
                            ?.IsInheritedIdentifyingRenamed ==
                            true))
                                            .OrderBy(
                        p => p
                        .PropertyName)
                                            .Select(
                        p =>
                        new
                    {
                        p.IsServerAssigned,
                        IsUniqueId
                            = UniqueIdSpecification
                              .IsUniqueId(
                                  p.PropertyName)
                              &&
                              PersonEntitySpecification
                              .IsPersonEntity(
                                  r.Name),
                        p.IsLookup,
                        CSharpType
                            = p
                              .PropertyType
                              .ToCSharp(
                                  false),
                        Name
                            = p
                              .PropertyName,
                        CSharpSafePropertyName
                            = p
                              .PropertyName
                              .MakeSafeForCSharpClass(
                                  r.Name),
                        LookupName
                            = p
                              .PropertyName
                    })
                                            .ToList(),
                    r.IsDerived,
                    InheritedNonIdentifyingProperties = r.IsDerived
                                ? r.AllProperties
                                                        .Where(p => p.IsInherited && !p.IsIdentifying)
                                                        .OrderBy(p => p.PropertyName)
                                                        .Where(IsModelInterfaceProperty)
                                                        .Select(
                        p =>
                        new
                    {
                        p.IsLookup,
                        CSharpType = p.PropertyType.ToCSharp(true),
                        Name       = p.PropertyName,
                        LookupName = p.PropertyName.TrimSuffix("Id")
                    })
                                                        .ToList()
                                : null,
                    NonIdentifyingProperties = r.NonIdentifyingProperties
                                               .Where(p => !p.IsInherited)
                                               .OrderBy(p => p.PropertyName)
                                               .Where(IsModelInterfaceProperty)
                                               .Select(
                        p =>
                        new
                    {
                        p.IsLookup,
                        CSharpType =
                            p.PropertyType.ToCSharp(true),
                        Name = p.PropertyName,
                        CSharpSafePropertyName =
                            p.PropertyName
                            .MakeSafeForCSharpClass(r.Name),
                        LookupName =
                            p.PropertyName.TrimSuffix("Id")
                    })
                                               .ToList(),
                    HasNavigableOneToOnes = r.EmbeddedObjects.Any(),
                    NavigableOneToOnes    = r
                                            .EmbeddedObjects
                                            .Where(eo => !eo.IsInherited)
                                            .OrderBy(
                        eo
                        => eo
                        .PropertyName)
                                            .Select(
                        eo
                        => new
                    {
                        Name
                            = eo
                              .PropertyName
                    })
                                            .ToList(),
                    InheritedLists = r.IsDerived
                                ? r.Collections
                                     .Where(c => c.IsInherited)
                                     .OrderBy(c => c.PropertyName)
                                     .Select(
                        c => new
                    {
                        c.ItemType.Name,
                        PluralName = c.PropertyName
                    })
                                     .ToList()
                                : null,
                    Lists = r.Collections
                            .Where(c => !c.IsInherited)
                            .OrderBy(c => c.PropertyName)
                            .Select(
                        c => new
                    {
                        c.ItemType.Name,
                        PluralName = c.PropertyName
                    })
                            .ToList(),
                    HasDiscriminator    = r.HasDiscriminator(),
                    AggregateReferences =
                        r.Entity?.GetAssociationsToReferenceableAggregateRoots()
                        .OrderBy(a => a.Name)
                        .Select(
                            a => new
                    {
                        AggregateReferenceName = a.Name,
                        MappedReferenceDataHasDiscriminator =
                            a.OtherEntity.HasDiscriminator()
                    })
                        .ToList()
                })
                             .ToList()
            };

            return(entityInterfacesModel);
        }