From PetaPoco to NPoco (#1207)
* NPoco - 2.x (builds) * NPoco - v3.1 (does not build) * NPoco - builds * NPoco - configure database factory (tests fail) * Pick fix from 7.4 * NPoco - stock v3.1 - sort-of working * NPoco - fix merge * Fix Newtonsoft.Json in web.Template.Debug.config * NPoco - fix SELECT * * NPoco - fixing repositories * NPoco - fix EntityRepository * NPoco - fix EntityRepository * NPoco - cosmetic * NPoco - use 3.1.0-u001 from github/zpqrtbnk/NPoco * Fixes build, NPoco needed to be referenced in the cms and UmbracoExamine projects * Fixes lots of tests * fixes more tests * NPoco - bugfixing * Bugfix CacheHelper in tests * Bugfix connection mocking in tests * NPoco - inject database in Sql.Select<> * NPoco - discovery retry policy only once * Enable C# 6 for Umbraco.Core * NPoco - introduce UmbracoSql, cleanup * NPoco - more cleanup and fixing * NPoco - fix UserRepository * Optimize InGroupsOf * Implement UmbracoDatabase.FetchByGroups * NPoco - fix Select * NPoco - simplify GetPagedResultsByQuery * Cherry-pick DisableBrowserCacheAttribute fix from 7.4 * Upgrade NPoco to use Sql<TContext> * U4-8257 - cleanup relators * 4-8257 - cleanup more relators * Upgrade NPoco with more OOTB version * fixes a couple tests, changes double check lock to Lazy<T>
This commit is contained in:
committed by
Shannon Deminick
parent
1b8747bd6d
commit
365a01a476
@@ -23,16 +23,20 @@ namespace Umbraco.Core.DependencyInjection
|
||||
{
|
||||
container.RegisterSingleton<IDatabaseFactory>(factory => new DefaultDatabaseFactory(GlobalSettings.UmbracoConnectionName, factory.GetInstance<ILogger>()));
|
||||
container.RegisterSingleton<DatabaseContext>(factory => GetDbContext(factory));
|
||||
|
||||
container.RegisterSingleton<SqlSyntaxProviders>(factory => SqlSyntaxProviders.CreateDefault(factory.GetInstance<ILogger>()));
|
||||
container.Register<ISqlSyntaxProvider>(factory => factory.GetInstance<DatabaseContext>().SqlSyntax);
|
||||
|
||||
container.RegisterSingleton<IUnitOfWorkProvider, FileUnitOfWorkProvider>();
|
||||
container.RegisterSingleton<IDatabaseUnitOfWorkProvider>(factory => new PetaPocoUnitOfWorkProvider(factory.GetInstance<ILogger>()));
|
||||
container.RegisterSingleton<IDatabaseUnitOfWorkProvider>(factory => new NPocoUnitOfWorkProvider(factory.GetInstance<IDatabaseFactory>()));
|
||||
|
||||
container.RegisterSingleton<IMappingResolver>(factory => new MappingResolver(
|
||||
factory.GetInstance<IServiceContainer>(),
|
||||
factory.GetInstance<ILogger>(),
|
||||
() => factory.GetInstance<PluginManager>().ResolveAssignedMapperTypes()));
|
||||
container.Register<RepositoryFactory>();
|
||||
container.Register<ISqlSyntaxProvider>(factory => factory.GetInstance<DatabaseContext>().SqlSyntax);
|
||||
container.RegisterSingleton<CacheHelper>(factory => CacheHelper.CreateDisabledCacheHelper(), "DisabledCache");
|
||||
|
||||
container.RegisterSingleton<IFileSystem>(factory => new PhysicalFileSystem(SystemDirectories.Scripts), "ScriptFileSystem");
|
||||
container.RegisterSingleton<IFileSystem>(factory => new PhysicalFileSystem(SystemDirectories.MvcViews + "/Partials/"), "PartialViewFileSystem");
|
||||
container.RegisterSingleton<IFileSystem>(factory => new PhysicalFileSystem(SystemDirectories.MvcViews + "/MacroPartials/"), "PartialViewMacroFileSystem");
|
||||
|
||||
Reference in New Issue
Block a user