12345678910111213141516171819202122232425 |
- using Microsoft.EntityFrameworkCore;
- using System.Configuration;
- using System.Windows;
- [assembly: ThemeInfo(ResourceDictionaryLocation.None,
- ResourceDictionaryLocation.SourceAssembly)]
- public class Book
- {
- public int Id { get; set; }
- public string Name { get; set; }
- public decimal Price { get; set; }
- public string Category { get; set; }
- public string Author { get; set; }
- }
- public class BookStoreContext : DbContext
- {
- public DbSet<Book> Books { get; set; }
- public BookStoreContext() { }
- protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
- { optionsBuilder.UseSqlServer(ConfigurationManager.ConnectionStrings["BookStore"].ConnectionString); }
- }
|