本文整理汇总了C#中ConfigurationExpression.AddRegistry方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationExpression.AddRegistry方法的具体用法?C# ConfigurationExpression.AddRegistry怎么用?C# ConfigurationExpression.AddRegistry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigurationExpression
的用法示例。
在下文中一共展示了ConfigurationExpression.AddRegistry方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
public void Configure(ConfigurationExpression cfg, IFoundationConfigurator foundationConfigurator)
{
if (foundationConfigurator.UseQueryContainer)
{
cfg.AddRegistry(new QueryRegistery());
cfg.For<IQueryRegistery>().Use<QueryRegistery>();
}
if (foundationConfigurator.UseBuseinssManagers)
{
cfg.AddRegistry(new BusinessManagerRegistery());
cfg.For<IBusinessManagerRegistery>().Use<BusinessManagerRegistery>();
cfg.For<IBusinessManagerInvocationLogger>(foundationConfigurator.Business.BusinessInvocationLogger, true);
}
if (foundationConfigurator.UseEmailing)
{
cfg.AddRegistry(new EmailRegistery());
cfg.For<IEmailLogger>(foundationConfigurator.Business.EmailLogger);
}
if (foundationConfigurator.Web.FlashMessenger != null)
{
cfg.For<IFlashMessenger>(foundationConfigurator.Web.FlashMessenger);
}
cfg.AddRegistry(new SecurityRegistery());
}
示例2: Configure
public void Configure(ConfigurationExpression cfg, IFoundationConfigurator foundationConfigurator)
{
if (foundationConfigurator.UsePresistence)
{
cfg.AddRegistry(new PersistenceRegistery());
cfg.For<IConnectionString>()
.Use(new ConnectionString(foundationConfigurator.Persistence.ConnectionStringKeyName));
}
}
示例3: Configure
static void Configure(ConfigurationExpression x)
{
x.AddRegistry(new MyAppRegistry());
x.For<IObjectContainer>()
.Singleton()
.Use(Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), DbPath));
x.For(typeof (IRepository<>))
.Use(typeof (Repository<>));
}
示例4: ConfigureDependencies
private static void ConfigureDependencies(ConfigurationExpression cfg)
{
cfg.AddRegistry(new PersistenceRegistery());
cfg.AddRegistry(new WebRegistery());
cfg.AddRegistry(new QueryRegistery());
cfg.AddRegistry(new BusinessManagerRegistery());
cfg.For<IQueryRegistery>().Use<QueryRegistery>();
cfg.For<IBusinessManagerRegistery>().Use<BusinessManagerRegistery>();
cfg.For<IBusinessManagerInvocationLogger>().Singleton().Use<SqlProcBusinessManagerInvocationLogger>();
cfg.For<ITypeHolder>().Use<TypeHolder>();
cfg.For<IConnectionString>().Use(new ConnectionString("KafalaDB"));
}
示例5: SetupContainer
private static void SetupContainer(ConfigurationExpression x)
{
x.AddRegistry<AppSettingProviderRegistry>();
x.For<IHttpSession>().Use<CurrentHttpContextSession>();
x.Scan(i =>
{
i.TheCallingAssembly();
i.Convention<SettingsScanner>();
});
x.For<ISettingsProvider>().Use<AppSettingsProvider>();
x.SetAllProperties(s => s.Matching(p => p.Name.EndsWith("Settings")));
}
示例6: ConfigureDependencies
public static void ConfigureDependencies(ConfigurationExpression cfg)
{
cfg.AddRegistry(new PersistenceRegistery());
cfg.AddRegistry(new QueryRegistery());
cfg.AddRegistry(new BusinessManagerRegistery());
cfg.For<IQueryRegistery>().Use<QueryRegistery>();
cfg.For<IBusinessManagerRegistery>().Use<BusinessManagerRegistery>();
cfg.For<IBusinessManagerInvocationLogger>().Singleton().Use<SqlProcBusinessManagerInvocationLogger>();
cfg.For<IConnectionString>().Use(new ConnectionString("KafalaDBTest"));
cfg.For<IEmailMessageSender>().Use<SwllowEmailService>();
cfg.For<IAuthenticationService>().Use<AuthenticationService>();
cfg.For<IPasswordHelper>().Use<PasswordHelper>();
}
示例7: Configure
public void Configure(ConfigurationExpression cfg, IFoundationConfigurator foundationConfigurator)
{
if (foundationConfigurator.UseWeb)
{
cfg.AddRegistry(new WebRegistery(foundationConfigurator));
cfg.For<IResourcesLocator>().Use(foundationConfigurator.Web);
// this.RegisterPagingAndSortingModelBinders(foundationConfigurator.Web.ViewModelsAssemblyHookType);
ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory(ObjectFactory.Container));
DependencyResolver.SetResolver(new StructureMapDependencyResolver(ObjectFactory.Container));
if (foundationConfigurator.Web.PagingConfigurations != null)
{
WebConfigurations.PagingConfigurations =
foundationConfigurator.Web.PagingConfigurations;
}
}
}
示例8: OnConfigureNHibernate
private static void OnConfigureNHibernate(ConfigurationExpression cfg)
{
HibernatingRhinos.NHibernate.Profiler.Appender.NHibernateProfiler.Initialize();
var configuration = Fluently.Configure()
.Mappings(x => x.AutoMappings.Add(AutoMap.AssemblyOf<Person>().Where(t => typeof(Person).IsAssignableFrom(t))))
.Database(SQLiteConfiguration.Standard.InMemory().ShowSql());
var sessionFactory = configuration.BuildSessionFactory();
// Configure nhibernate
cfg.For<ISessionFactory>().Singleton().Use(sessionFactory);
cfg.For<ISession>().Singleton().Use(x =>
{
var session = x.GetInstance<ISessionFactory>().OpenSession();
session.FlushMode = FlushMode.Commit;
using (var tx =session.BeginTransaction())
{
new SchemaExport(configuration.BuildConfiguration()).Execute(true, true, false, session.Connection, null);
tx.Commit();
}
return session;
});
// Configure our IoC container for a nhibernaterepository
cfg.AddRegistry(new LixNHibernateRegistry());
// include the LixRegistry
cfg.AddRegistry(new LixRegistry());
cfg.Scan(s =>
{
s.TheCallingAssembly();
s.WithDefaultConventions();
});
}
示例9: Configure
private static void Configure(ConfigurationExpression x)
{
x.AddRegistry<CoinSorterRegistry>();
x.AddRegistry<CoinIdentifierRegistry>();
x.AddRegistry<CoinCheckRegistry>();
}
示例10: Configure
private static void Configure(ConfigurationExpression x)
{
x.AddRegistry<SharlotkaRegistry>();
}
示例11: InitializeContainer
protected override void InitializeContainer(ConfigurationExpression configuration)
{
configuration.AddRegistry<WebRegistry>();
}