123456789101112131415161718 |
- using Microsoft.EntityFrameworkCore;
- using System.Configuration;
- namespace BookStore_
- {
- class BookStoreContext : DbContext
- {
- public DbSet<Book> Books { get; set; }
- public BookStoreContext()
- {
- }
- protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
- {
- optionsBuilder.UseSqlServer(ConfigurationManager.ConnectionStrings["BookStore"].ConnectionString);
- }
- }
- }
|