public AdditionalPhonesController( ContactsAppDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public ContactsController( ContactsAppDbContext context, IMapper mapper, IHubContext <NotificationHub> hubContext) { this.context = context; this.mapper = mapper; this.hubContext = hubContext; }
public AccountsController( ContactsAppDbContext context, UserManager <IdentityUser> userManager, RoleManager <IdentityRole> roleManager, SignInManager <IdentityUser> signInManager, TokenGenerator tokenGenerator) { this.context = context; this.userManager = userManager; this.roleManager = roleManager; this.signInManager = signInManager; this.tokenGenerator = tokenGenerator; }
protected override void ConfigureWebHost(IWebHostBuilder builder) { builder.ConfigureServices(services => { // Create a new service provider. var serviceProvider = new ServiceCollection() .AddEntityFrameworkInMemoryDatabase() .BuildServiceProvider(); // Add a database context (ApplicationDbContext) using an in-memory // database for testing. services.AddDbContext <ContactsAppDbContext>(options => { options.UseInMemoryDatabase("InMemoryDbForTesting"); options.UseInternalServiceProvider(serviceProvider); }); // Build the service provider. var sp = services.BuildServiceProvider(); DbContext = sp.GetRequiredService <ContactsAppDbContext>(); DbContext.Database.EnsureCreated(); }); }
public AdditionalPhonesController(ContactsAppDbContext context) { _context = context; }
public ContactsController(ContactsAppDbContext context) { _context = context; }
public BaseRepository(ContactsAppDbContext db) { _db = db; DbSet = db.Set <TEntity>(); }