public static KodkodDbContext GetEmptyDbContext() { var optionsBuilder = new DbContextOptionsBuilder <KodkodDbContext>(); optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString()); optionsBuilder.UseLazyLoadingProxies(); var inMemoryContext = new KodkodDbContext(optionsBuilder.Options); return(inMemoryContext); }
public TestBase() { // disable automapper static registration ServiceCollectionExtensions.UseStaticRegistration = false; // Initialize mapper Mapper = new Mapper( new MapperConfiguration( configure => { configure.AddProfile<ApplicationMappingProfile>(); } ) ); Client = GetTestServer(); _testUserFormData = new Dictionary<string, string> { {"email", "*****@*****.**"}, {"username", "testuser"}, {"password", "123qwe"} }; KodkodInMemoryContext = GetInitializedDbContext(); ContextUser = GetContextUser(); }
public Repository(KodkodDbContext dbContext) { DbContext = dbContext; DbSet = DbContext.Set <TEntity>(); }
public KodkodDbContextActionFilter(KodkodDbContext context) { _context = context; }