internal UniformConfigurator RegisterInMemoryUniform(IContainer container) { UniformContext uniformContext = new InMemoryContext(); container.Configure(config => config.For<UniformContext>().Singleton().Use(uniformContext)); return this; }
public static RoleManager<IdentityRole> CreateRoleManager(InMemoryContext context) { var services = new ServiceCollection(); services.AddIdentity<IdentityUser, IdentityRole>(); services.AddInstance<IRoleStore<IdentityRole>>(new RoleStore<IdentityRole>(context)); return services.BuildServiceProvider().GetRequiredService<RoleManager<IdentityRole>>(); }
public static InMemoryContext CreateContext() { var services = new ServiceCollection(); services.AddEntityFramework().AddInMemoryDatabase(); var serviceProvider = services.BuildServiceProvider(); var db = new InMemoryContext(); db.Database.EnsureCreated(); return db; }
public static UserManager<InMemoryUser> CreateManager(InMemoryContext context) { return MockHelpers.CreateManager<InMemoryUser>(() => new InMemoryUserStore<InMemoryUser>(context)); }
public UnitOfWorkMem() { context = new InMemoryContext(); CustomerRepository = new CustomerRepositoryEFMemory(context); }
public InMemoryUsersRepository(InMemoryContext context) { this.context = context; }
public GenreRepositoryInEF(InMemoryContext context) { this.context = context; }
public VideoRepositoryEFMemory(InMemoryContext context) { this.context = context; }
public ProfileRepositoryShould() { _context = new InMemoryContext(); _repository = new ProfileRepository(_context); }
public BloggerController(InMemoryContext memoryContext) { this.memoryContext = memoryContext; }
public GenreRepository(InMemoryContext context) { _context = context; }
public GenericEntityRepositoryTests() { _fooRepository = new GenericEntityRepository <Foo>(null); _context = InMemoryContext.Create(); _fooRepository.SetContext(_context); }
public InMemoryTrainingRepository(InMemoryContext context) { this.context = context; }
public InternalDbService() { var optionBuilder = new DbContextOptionsBuilder().UseInMemoryDatabase("InMemoryDb");; _DbInMemoryContext = new InMemoryContext(optionBuilder.Options); }
public UnitOfWorkMem() { context = new InMemoryContext(); UserEventRepository = new UserEventRepositoryEFMemory(context); }
public void Inititalize() { var optionBuilder = new DbContextOptionsBuilder().UseInMemoryDatabase("InMemoryDb");; DbContext = new InMemoryContext(optionBuilder.Options); }
public static RoleManager<IdentityRole> CreateRoleManager(InMemoryContext context) { var services = CreateTestServices(); services.AddSingleton<IRoleStore<IdentityRole>>(new RoleStore<IdentityRole>(context)); return services.BuildServiceProvider().GetRequiredService<RoleManager<IdentityRole>>(); }
public UnitOfWorkMem() { context = new InMemoryContext(); VidRepo = new VidRepoEFMemory(context); }
public AddBookView() { InitializeComponent(); _context = InMemoryContext.Instance; }
public virtual void RestoreData() { InMemoryContext context = (InMemoryContext)this.CurrentDataSource; context.RestoreData(); }