Exemplo n.º 1
0
 public Func <IServiceProvider, object> GetRepositoryServiceFactory()
 {
     return(new Func <IServiceProvider, object>((svcs) =>
     {
         object repo = null;
         if (Factory == null)
         {
             repo = svcs.GetRequiredService(Type);
         }
         else
         {
             repo = Factory(svcs);
         }
         var inst = new RepositoryInstance(this, repo);
         return Activator.CreateInstance(ServiceType, inst, inst.QueryHandlers.Select(c => c.Model.Query));
     }));
 }
Exemplo n.º 2
0
 public RepositoryService(RepositoryInstance instance, IEnumerable <QueryModel> query)
 {
     _instance = instance;
     Queries   = instance.Model.QueryHandlers.Select(c => c.Query);
 }