Exemplo n.º 1
0
        private async Task <CompanyRecordsDBContext> CreateDbContext(string name)
        {
            var options = new DbContextOptionsBuilder <CompanyRecordsDBContext>()

                          .UseInMemoryDatabase(databaseName: name)
                          .Options;

            var context = new CompanyRecordsDBContext(options);

            var companies = GetFakeData();
            await context.AddRangeAsync(companies);

            await context.SaveChangesAsync();

            return(context);
        }
Exemplo n.º 2
0
 public CompanyService(CompanyRecordsDBContext context)
 {
     _context = context;
 }