Moving RepositoryFactory to constructor to avoid hard dependency on the RepositoryResolver in the services.

This commit is contained in:
Morten Christensen
2012-12-12 10:47:14 -01:00
parent f800744e4f
commit 877c38b8bc
5 changed files with 49 additions and 46 deletions

View File

@@ -43,7 +43,7 @@ namespace Umbraco.Core.Persistence
internal TRepository ResolveByType<TRepository>(IUnitOfWork unitOfWork)
where TRepository : class, IRepository
{
var createMethod = this.Value.GetType().GetMethods()
var createMethod = this.Value.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public)
.First(x => x.Name == "Create" + typeof (TRepository).Name.Substring(1));
if (createMethod.GetParameters().Count() != 1