AssemblyInfo.cs 716 B

12345678910111213141516171819202122232425
  1. using Microsoft.EntityFrameworkCore;
  2. using System.Configuration;
  3. using System.Windows;
  4. [assembly: ThemeInfo(ResourceDictionaryLocation.None,
  5. ResourceDictionaryLocation.SourceAssembly)]
  6. public class Book
  7. {
  8. public int Id { get; set; }
  9. public string Name { get; set; }
  10. public decimal Price { get; set; }
  11. public string Category { get; set; }
  12. public string Author { get; set; }
  13. }
  14. public class BookStoreContext : DbContext
  15. {
  16. public DbSet<Book> Books { get; set; }
  17. public BookStoreContext() { }
  18. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  19. { optionsBuilder.UseSqlServer(ConfigurationManager.ConnectionStrings["BookStore"].ConnectionString); }
  20. }