ApplicationContext.cs 553 B

1234567891011121314151617
  1. using Microsoft.EntityFrameworkCore;
  2. namespace API_development
  3. {
  4. public class ApplicationContext:DbContext
  5. {
  6. //перечень всех таблиц в базе данных
  7. public DbSet<Users> tbUsers { get; set; }
  8. public DbSet<Hobbies> tbHobbies { get; set; }
  9. public DbSet<UsersHobbies> tbUserHobbies { get; set; }
  10. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  11. {
  12. optionsBuilder.UseSqlServer(BaseConnect.SQLConnection);
  13. }
  14. }
  15. }