public PersonSearchService( IIndex <String, IPersonSearchStrategy <PersonName> > personNameSearchStrategyFactory, IIndex <String, IPersonSearchStrategy <PersonIdentification> > personIdentificationSearchStrategyFactory, IIndex <String, IPersonExpSearchStrategy <PersonName> > personNameExpSearchStrategyFactory, IIndex <String, IPersonExpSearchStrategy <PersonIdentification> > personIdentificationExpSearchStrategyFactory, IPersonDbContext personDbContext ) { _personDbContext = personDbContext; _personNameSearchStrategyFactory = personNameSearchStrategyFactory; _personIdentificationSearchStrategyFactory = personIdentificationSearchStrategyFactory; _personNameExpSearchStrategyFactory = personNameExpSearchStrategyFactory; _personIdentificationExpSearchStrategyFactory = personIdentificationExpSearchStrategyFactory; _personQuery = _personDbContext.Persons; _personExpression = null; }
private Task ParallelNoWait() { using (var scope = _lifetimeScope.BeginLifetimeScope()) { _personDbContext = scope.Resolve <IPersonDbContext>(); Task.Delay(5000).Wait(); Log.Debug("testing before"); try { var x = _personDbContext.Persons.SingleOrDefaultAsync(p => p.Id == 2); Log.Debug("testing afterrrrr {@x}", x); } catch (System.Exception e) { Log.Error(e, "GG"); } } return(Task.CompletedTask); }
public PersonRepository(IPersonDbContext dbContext) { _dbContext = dbContext; }