public EntityFrameworkCoreFeaturesStore Build()
        {
            var loggerFactory = new LoggerFactory();
            var diagnostics   = new EsquioEntityFrameworkCoreStoreDiagnostics(loggerFactory);

            var dbContext = new StoreDbContext(_options, new StoreOptions());
            var store     = new EntityFrameworkCoreFeaturesStore(dbContext, diagnostics);

            return(store);
        }
Ejemplo n.º 2
0
        //private readonly Fixture _fixture;

        //public entityextensions_should(Fixture fixture)
        //{
        //    _fixture = fixture;
        //    _fixture.Options = DbContextOptions<StoreDbContext>)o)).ToList();

        //    foreach (var options in _fixture.Options)
        //    {
        //        using (var context = new StoreDbContext(options, new StoreOptions()))
        //        {
        //            context.Database.EnsureCreated();

        //            AddData(context);
        //        }
        //    }
        //}

        public EntityFrameworkCoreFeaturesStore Build()
        {
            var loggerFactory = new LoggerFactory();
            var diagnostics   = new EsquioEntityFrameworkCoreStoreDiagnostics(loggerFactory);

            var connectionString = _fixture.IsAppVeyorExecution ?
                                   $@"Server=(local)\SQL2016;Database=Test.Esquio.EntityFramework-3.0.0.Extensions;User ID=sa;Password=Password12!" :
                                   $@"Server=tcp:localhost,1833;Database=Test.Esquio.EntityFramework-3.0.0.Extensions;User ID=sa;Password=Password12!";

            var builder = new DbContextOptionsBuilder <StoreDbContext>();

            builder.UseSqlServer(connectionString);

            return(new EntityFrameworkCoreFeaturesStore(new StoreDbContext(builder.Options, new StoreOptions()), diagnostics));
        }
 public EntityFrameworkCoreFeaturesStore(StoreDbContext storeDbContext, EsquioEntityFrameworkCoreStoreDiagnostics diagnostics)
 {
     _storeDbContext = storeDbContext ?? throw new ArgumentNullException(nameof(storeDbContext));
     _diagnostics    = diagnostics ?? throw new ArgumentNullException(nameof(diagnostics));
 }