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); }); }
public void Initialize(IComponentConfigurator componentConfigurator) { if (componentConfigurator == null) { throw new ArgumentNullException(nameof(componentConfigurator)); } componentConfigurator.WithMappingsProvidedBy <AttributesMappingSourceProvider>(); }
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); }
public void Initialize(IComponentConfigurator componentConfigurator) { if (componentConfigurator == null) { throw new ArgumentNullException(nameof(componentConfigurator)); } componentConfigurator.WithMappingsProviderVisitor <CollectionStorageModelConventionVisitor>(); componentConfigurator.WithMappingsProviderVisitor <ConverterConventionVisitor>(); }
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"); }
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>(); }
public static IComponentConfigurator <ControllersContext> Assembly(this IComponentConfigurator <ControllersContext> configurator, Assembly assembly) { configurator.Configure(c => c.Assemblies.Add(assembly)); return(configurator); }
public static IComponentConfigurator <T> Name <T>(this IComponentConfigurator <T> configurator, string name) where T : class, ILifeTimeContext { configurator.Configure(x => x.Name = name); return(configurator); }
public static IComponentConfigurator <StoreContext> DataStore <T>(this IComponentConfigurator <T> configurator) where T : DataSourceContext { return(configurator.Child(new StoreContext(), (d, identity) => { })); }
public static IComponentConfigurator <IdentityContext> Role <T>(this IComponentConfigurator <IdentityContext> configurator) { configurator.Configure(c => c.RoleType = typeof(T)); return(configurator); }
public static IComponentConfigurator <EntityDataContext> Context <T>(this IComponentConfigurator <EntityDataContext> configurator) where T : DbContext { configurator.Configure(c => c.ContextType = typeof(T)); return(configurator); }
public static IComponentConfigurator <T> PerThread <T>(this IComponentConfigurator <T> configurator) where T : class, ILifeTimeContext { return(configurator.LifeTime(Life.LifeTime.PerThread)); }
public static IComponentConfigurator <T> Transient <T>(this IComponentConfigurator <T> configurator) where T : class, ILifeTimeContext { return(configurator.LifeTime(Life.LifeTime.Transient)); }
public static IComponentConfigurator <T> Singleton <T>(this IComponentConfigurator <T> configurator) where T : class, ILifeTimeContext { return(configurator.LifeTime(Life.LifeTime.Singleton)); }
public static IComponentConfigurator <ControllersContext> AssemblyCalling(this IComponentConfigurator <ControllersContext> configurator) { return(configurator.Assembly(System.Reflection.Assembly.GetCallingAssembly())); }
public static IComponentConfigurator <HibernateDataContext> UpdateSchema(this IComponentConfigurator <HibernateDataContext> configurator) { configurator.Configure(c => c.UpdateSchema = true); return(configurator); }
public static IComponentConfigurator <SitemapContext> Node <T>(this IComponentConfigurator <SitemapContext> configurator) { return(configurator.Node(typeof(T))); }
public static IComponentConfigurator <StoreContext> Intercept(this IComponentConfigurator <StoreContext> configurator, Action <IServiceInterception> interceptioAction) { configurator.Configure(c => c.Interceptor = interceptioAction); return(configurator); }
public static IComponentConfigurator <SitemapContext> Node(this IComponentConfigurator <SitemapContext> configurator, Type nodeType) { configurator.Configure(c => c.NodeType = nodeType); return(configurator); }
public static IComponentConfigurator <StoreContext> DataSource(this IComponentConfigurator <StoreContext> configurator, string dataSource) { configurator.Configure(x => x.DataSource = dataSource); return(configurator); }
public static IComponentConfigurator <SitemapContext> Source(this IComponentConfigurator <SitemapContext> configurator, string sitemapPath) { configurator.Configure(c => c.Source = sitemapPath); return(configurator); }
public void Initialize(IComponentConfigurator componentConfigurator) { componentConfigurator.WithConverter <TestConverter>(); }
public static IComponentConfigurator <ControllersContext> AssemblyWithType <T>(this IComponentConfigurator <ControllersContext> configurator) { return(configurator.AssemblyWithType(typeof(T))); }
public static IComponentConfigurator <IdentityContext> UserManager <T>(this IComponentConfigurator <IdentityContext> configurator) { configurator.Configure(c => c.UserManagerType = typeof(T)); return(configurator); }
public static IComponentConfigurator <ControllersContext> AssemblyWithType(this IComponentConfigurator <ControllersContext> configurator, Type type) { return(configurator.Assembly(type.Assembly)); }
public static IComponentConfigurator <T> ConnectionString <T>(this IComponentConfigurator <T> configurator, string connectionString) where T : DataSourceContext { configurator.Configure(c => c.ConnectionString = connectionString); return(configurator); }
public static IComponentConfigurator <T> LifeTime <T>(this IComponentConfigurator <T> configurator, LifeTime lifeTime) where T : class, ILifeTimeContext { configurator.Configure(x => x.LifeTime = lifeTime); return(configurator); }