Ejemplo n.º 1
0
 public TransactionBehaviour(
     OperationalDbContext dbContext,
     ILogger <TransactionBehaviour <TRequest, TResponse> > logger)
 {
     _dbContext = dbContext;
     _logger    = logger;
 }
Ejemplo n.º 2
0
    public IntegrationEventLogService(OperationalDbContext dbContext, Func <List <Type> > eventTypes)
    {
        _dbContext  = dbContext;
        _eventTypes = eventTypes();

        ScopeId = Guid.NewGuid().ToString("N");
    }
Ejemplo n.º 3
0
 public IntegrationEventLogServiceFixture AddNonScopedEventEntries(int total, EventStateEnum state)
 {
     for (int i = 0; i < total; i++)
     {
         var entry = GetLogEntry(string.Empty, state);
         OperationalDbContext.IntegrationEventLogs.Add(entry);
     }
     OperationalDbContext.SaveChanges();
     return(this);
 }
Ejemplo n.º 4
0
 public UnitOfWork(
     OperationalDbContext dbContext,
     ILogger <UnitOfWork> logger,
     IIntegrationEventLogService eventLogService,
     IEventsPublisher eventsPublisher)
 {
     _dbContext       = dbContext;
     _logger          = logger;
     _eventLogService = eventLogService;
     _eventsPublisher = eventsPublisher;
 }
Ejemplo n.º 5
0
        public IntegrationEventLogServiceFixture AddScopedEventEntries(int total, EventStateEnum state)
        {
            var scopeId = EventLogService.ScopeId;

            for (var i = 0; i < total; i++)
            {
                var entry = GetLogEntry(scopeId, state);
                OperationalDbContext.IntegrationEventLogs.Add(entry);
            }
            OperationalDbContext.SaveChanges();
            return(this);
        }
Ejemplo n.º 6
0
        private static void CreateSut(out IServiceScope scope, out OperationalDbContext context, out AuthorizationCodeStore sut)
        {
            var provider = new ServiceCollection()
                           .AddLogging()
                           .AddOperationalEntityFrameworkStores(options =>
                                                                options.UseInMemoryDatabase(GenerateId()))
                           .BuildServiceProvider();

            scope = provider.CreateScope();
            var serviceProvider = scope.ServiceProvider;

            context = serviceProvider.GetRequiredService <OperationalDbContext>();
            sut     = serviceProvider.GetRequiredService <AuthorizationCodeStore>();
        }
Ejemplo n.º 7
0
        public IntegrationEventLogServiceFixture()
        {
            ContextOptions = new DbContextOptionsBuilder <OperationalDbContext>()
                             .UseInMemoryDatabase("ExpensesDb").Options;
            OperationalDbContext = new OperationalDbContext(ContextOptions);
            OperationalDbContext.Database.EnsureDeleted();
            OperationalDbContext.Database.EnsureCreated();

            EventLogService = new IntegrationEventLogService(
                OperationalDbContext,
                () => new List <Type>
            {
                typeof(FakeIntegrationEvent)
            });
        }
Ejemplo n.º 8
0
        private static void CreateSut(out IServiceScope scope, out OperationalDbContext context, out AuthorizationCodeStore sut)
        {
            var provider = new ServiceCollection()
                           .AddLogging()
                           .Configure <MemoryCacheOptions>(options => { })
                           .Configure <IdentityServer4.Configuration.IdentityServerOptions>(options => { })
                           .AddTransient(p => p.GetRequiredService <IOptions <IdentityServer4.Configuration.IdentityServerOptions> >().Value)
                           .AddScoped(typeof(IFlushableCache <>), typeof(FlushableCache <>))
                           .AddOperationalEntityFrameworkStores(options =>
                                                                options.UseInMemoryDatabase(GenerateId()))
                           .BuildServiceProvider();

            scope = provider.CreateScope();
            var serviceProvider = scope.ServiceProvider;

            context = serviceProvider.GetRequiredService <OperationalDbContext>();
            sut     = serviceProvider.GetRequiredService <AuthorizationCodeStore>();
        }
Ejemplo n.º 9
0
 public MsSqlOperationsRegistry(OperationContext operationContext, OperationalDbContext dbContext)
 {
     _operationContext = operationContext;
     _dbContext        = dbContext;
 }
Ejemplo n.º 10
0
 public OperationsDal(OperationalDbContext context, ILogger <OperationsDal> logger)
 {
     _dbContext = context;
     _logger    = logger;
 }