コード例 #1
0
        public void Initialize(IComponentConfigurator componentConfigurator)
        {
            if (componentConfigurator == null)
            {
                throw new ArgumentNullException(nameof(componentConfigurator));
            }

            componentConfigurator.WithMappingsProvidedBy <FluentMappingSourceProvider>();
            componentConfigurator.WithComponent <DefaultMappingsRepository, DefaultMappingsRepository>();
            componentConfigurator.WithComponent <IMappingsRepository, EntityAwareMappingsRepository>(
                Lifestyle.BoundToEntityContext,
                (container, mappingsRepository) =>
            {
                var context = container.Resolve <IEntityContext>();
                EntityContextExtensions.ExplicitMappings[context] = new DefaultExplicitMappings();
                if (EntityContextExtensions.ConverterProvider == null)
                {
                    EntityContextExtensions.ConverterProvider = container.Resolve <IConverterProvider>();
                    EntityContextExtensions.MappingVisitors   = container.Resolve <IEnumerable <IMappingProviderVisitor> >();
                    EntityContextExtensions.QIriMappings      = container.Resolve <IEnumerable <QIriMapping> >();
                }

                context.Disposed += (sender, args) => EntityContextExtensions.ExplicitMappings.Remove(context);
            });
        }
コード例 #2
0
        public void Initialize(IComponentConfigurator componentConfigurator)
        {
            if (componentConfigurator == null)
            {
                throw new ArgumentNullException(nameof(componentConfigurator));
            }

            componentConfigurator.WithMappingsProvidedBy <AttributesMappingSourceProvider>();
        }
コード例 #3
0
ファイル: StoreSetup.cs プロジェクト: shuk/Cortoxa
        public static IComponentConfigurator <StoreContext> Type(this IComponentConfigurator <StoreContext> configurator, Type type)
        {
            if (!type.IsClass)
            {
                throw new Exception("Repository type is not class");
            }

            configurator.Configure(x => x.StoreClass = type);
            return(configurator);
        }
コード例 #4
0
        public void Initialize(IComponentConfigurator componentConfigurator)
        {
            if (componentConfigurator == null)
            {
                throw new ArgumentNullException(nameof(componentConfigurator));
            }

            componentConfigurator.WithMappingsProviderVisitor <CollectionStorageModelConventionVisitor>();
            componentConfigurator.WithMappingsProviderVisitor <ConverterConventionVisitor>();
        }
コード例 #5
0
        public void Initialize(IComponentConfigurator componentConfigurator)
        {
            if (componentConfigurator == null)
            {
                throw new ArgumentNullException(nameof(componentConfigurator));
            }

            componentConfigurator.WithComponent <IChangeDetector, DefaultChangeDetector>(Lifestyle.BoundToEntityContext);
            componentConfigurator.WithComponent <IConverterProvider, DefaultConverterProvider>();
            componentConfigurator.WithInstance(new QIriMapping("xsd", xsd.Namespace), "xsd");
            componentConfigurator.WithInstance(new QIriMapping("rdf", rdf.Namespace), "rdf");
            componentConfigurator.WithInstance(new QIriMapping("rdfs", rdfs.Namespace), "rdfs");
            componentConfigurator.WithInstance(new QIriMapping("owl", owl.Namespace), "owl");
            componentConfigurator.WithInstance(new QIriMapping("oguid", oguid.Namespace), "oguid");
        }
コード例 #6
0
        public void Initialize(IComponentConfigurator componentConfigurator)
        {
            if (componentConfigurator == null)
            {
                throw new ArgumentNullException(nameof(componentConfigurator));
            }

            componentConfigurator.WithConverter <Base64BinaryConverter>();
            componentConfigurator.WithConverter <BooleanConverter>();
            componentConfigurator.WithConverter <DateTimeConverter>();
            componentConfigurator.WithConverter <DecimalConverter>();
            componentConfigurator.WithConverter <DurationConverter>();
            componentConfigurator.WithConverter <FloatingPointLiteralConverter>();
            componentConfigurator.WithConverter <GuidConverter>();
            componentConfigurator.WithConverter <IntegerConverter>();
            componentConfigurator.WithConverter <StringConverter>();
            componentConfigurator.WithConverter <UntypedLiteralConverter>();
            componentConfigurator.WithConverter <UriConverter>();
        }
コード例 #7
0
ファイル: ControllerExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <ControllersContext> Assembly(this IComponentConfigurator <ControllersContext> configurator, Assembly assembly)
 {
     configurator.Configure(c => c.Assemblies.Add(assembly));
     return(configurator);
 }
コード例 #8
0
ファイル: ComponentExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <T> Name <T>(this IComponentConfigurator <T> configurator, string name) where T : class, ILifeTimeContext
 {
     configurator.Configure(x => x.Name = name);
     return(configurator);
 }
コード例 #9
0
ファイル: DataExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <StoreContext> DataStore <T>(this IComponentConfigurator <T> configurator) where T : DataSourceContext
 {
     return(configurator.Child(new StoreContext(), (d, identity) =>
     {
     }));
 }
コード例 #10
0
ファイル: IdentitySetup.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <IdentityContext> Role <T>(this IComponentConfigurator <IdentityContext> configurator)
 {
     configurator.Configure(c => c.RoleType = typeof(T));
     return(configurator);
 }
コード例 #11
0
 public static IComponentConfigurator <EntityDataContext> Context <T>(this IComponentConfigurator <EntityDataContext> configurator) where T : DbContext
 {
     configurator.Configure(c => c.ContextType = typeof(T));
     return(configurator);
 }
コード例 #12
0
ファイル: ComponentExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <T> PerThread <T>(this IComponentConfigurator <T> configurator) where T : class, ILifeTimeContext
 {
     return(configurator.LifeTime(Life.LifeTime.PerThread));
 }
コード例 #13
0
ファイル: ComponentExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <T> Transient <T>(this IComponentConfigurator <T> configurator) where T : class, ILifeTimeContext
 {
     return(configurator.LifeTime(Life.LifeTime.Transient));
 }
コード例 #14
0
ファイル: ComponentExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <T> Singleton <T>(this IComponentConfigurator <T> configurator) where T : class, ILifeTimeContext
 {
     return(configurator.LifeTime(Life.LifeTime.Singleton));
 }
コード例 #15
0
ファイル: ControllerExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <ControllersContext> AssemblyCalling(this IComponentConfigurator <ControllersContext> configurator)
 {
     return(configurator.Assembly(System.Reflection.Assembly.GetCallingAssembly()));
 }
コード例 #16
0
ファイル: HibernateSetup.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <HibernateDataContext> UpdateSchema(this IComponentConfigurator <HibernateDataContext> configurator)
 {
     configurator.Configure(c => c.UpdateSchema = true);
     return(configurator);
 }
コード例 #17
0
 public static IComponentConfigurator <SitemapContext> Node <T>(this IComponentConfigurator <SitemapContext> configurator)
 {
     return(configurator.Node(typeof(T)));
 }
コード例 #18
0
ファイル: StoreSetup.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <StoreContext> Intercept(this IComponentConfigurator <StoreContext> configurator, Action <IServiceInterception> interceptioAction)
 {
     configurator.Configure(c => c.Interceptor = interceptioAction);
     return(configurator);
 }
コード例 #19
0
 public static IComponentConfigurator <SitemapContext> Node(this IComponentConfigurator <SitemapContext> configurator, Type nodeType)
 {
     configurator.Configure(c => c.NodeType = nodeType);
     return(configurator);
 }
コード例 #20
0
ファイル: StoreSetup.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <StoreContext> DataSource(this IComponentConfigurator <StoreContext> configurator, string dataSource)
 {
     configurator.Configure(x => x.DataSource = dataSource);
     return(configurator);
 }
コード例 #21
0
 public static IComponentConfigurator <SitemapContext> Source(this IComponentConfigurator <SitemapContext> configurator, string sitemapPath)
 {
     configurator.Configure(c => c.Source = sitemapPath);
     return(configurator);
 }
コード例 #22
0
 public void Initialize(IComponentConfigurator componentConfigurator)
 {
     componentConfigurator.WithConverter <TestConverter>();
 }
コード例 #23
0
ファイル: ControllerExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <ControllersContext> AssemblyWithType <T>(this IComponentConfigurator <ControllersContext> configurator)
 {
     return(configurator.AssemblyWithType(typeof(T)));
 }
コード例 #24
0
ファイル: IdentitySetup.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <IdentityContext> UserManager <T>(this IComponentConfigurator <IdentityContext> configurator)
 {
     configurator.Configure(c => c.UserManagerType = typeof(T));
     return(configurator);
 }
コード例 #25
0
ファイル: ControllerExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <ControllersContext> AssemblyWithType(this IComponentConfigurator <ControllersContext> configurator, Type type)
 {
     return(configurator.Assembly(type.Assembly));
 }
コード例 #26
0
ファイル: DataExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <T> ConnectionString <T>(this IComponentConfigurator <T> configurator, string connectionString) where T : DataSourceContext
 {
     configurator.Configure(c => c.ConnectionString = connectionString);
     return(configurator);
 }
コード例 #27
0
ファイル: ComponentExtentions.cs プロジェクト: shuk/Cortoxa
 public static IComponentConfigurator <T> LifeTime <T>(this IComponentConfigurator <T> configurator, LifeTime lifeTime) where T : class, ILifeTimeContext
 {
     configurator.Configure(x => x.LifeTime = lifeTime);
     return(configurator);
 }