ApplicationContext.cs 731 B

12345678910111213141516171819202122232425
  1. using Microsoft.EntityFrameworkCore;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using WpfApp1.Models;
  8. namespace WpfApp1
  9. {
  10. public class ApplicationContext : DbContext
  11. {
  12. public DbSet<Role> Role { get; set; } = null!;
  13. public DbSet<Users> Users { get; set; } = null!;
  14. public DbSet<Clients> Clients { get; set; } = null!;
  15. public DbSet<OrderStatus> OrderStatus { get; set; } = null!;
  16. public DbSet<Orders> Orders { get; set; } = null!;
  17. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  18. {
  19. optionsBuilder.UseSqlite("Data Source=data.db");
  20. }
  21. }
  22. }