Exemple #1
0
        /// <summary>
        /// Loads all mappings related to IdentityServer configuration into the NHibernate configuration.
        /// </summary>
        /// <param name="configuration">The NHibernate configuration.</param>
        /// <param name="options">The configuration store options.</param>
        public static Configuration AddConfigurationStoreMappings(this Configuration configuration, ConfigurationStoreOptions options)
        {
            var mapper = new ConfigurationStoreModelMapper(options);

            mapper.AddClientContextMappings();
            mapper.AddResourceContextMappings();
            configuration.AddMapping(mapper.CompileMappingForAllExplicitlyAddedEntities());
            return(configuration);
        }
        internal static ConfigurationStoreModelMapper AddClientContextMappings(this ConfigurationStoreModelMapper mapper)
        {
            mapper.AddMapping <ClientMap>();
            mapper.AddMapping <ClientGrantTypeMap>();
            mapper.AddMapping <ClientSecretMap>();
            mapper.AddMapping <ClientRedirectUriMap>();
            mapper.AddMapping <ClientPostLogoutRedirectUriMap>();
            mapper.AddMapping <ClientScopeMap>();
            mapper.AddMapping <ClientIdPRestrictionMap>();
            mapper.AddMapping <ClientClaimMap>();
            mapper.AddMapping <ClientCorsOriginMap>();
            mapper.AddMapping <ClientPropertyMap>();

            return(mapper);
        }
        internal static ConfigurationStoreModelMapper AddResourceContextMappings(this ConfigurationStoreModelMapper mapper)
        {
            mapper.AddMapping <IdentityResourceMap>();
            mapper.AddMapping <IdentityClaimMap>();
            mapper.AddMapping <IdentityResourcePropertyMap>();
            mapper.AddMapping <ApiResourceMap>();
            mapper.AddMapping <ApiResourcePropertyMap>();
            mapper.AddMapping <ApiResourceSecretMap>();
            mapper.AddMapping <ApiResourceClaimMap>();
            mapper.AddMapping <ApiResourceScopeMap>();
            mapper.AddMapping <ApiScopeMap>();
            mapper.AddMapping <ApiScopeClaimMap>();

            return(mapper);
        }