static async Task Main(string[] args) { //połączenie do bazy w pliku (localdb) var contextOptions = new DbContextOptionsBuilder <EFContext>() .UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=EFC"); using (var context = new EFContext(contextOptions.Options)) { context.Database.Migrate(); await new PeopleService(context).ReadAsync(); } //połączenie do bazy w SqlServer using (var context = new EFCContext()) { //context.Database.Migrate(); var result = context.Set <DAL2.Models.Person>().ToListAsync();; } }
public async Task <IEnumerable <T> > GetAll() { return(await _context.Set <T>().ToListAsync()); }