Brak opisu

ApplicationDatabaseContext.cs 1.3KB

123456789101112131415161718192021222324252627282930313233343536
  1. using Backend.Data.Interfaces;
  2. using Microsoft.AspNet.Identity.EntityFramework;
  3. using Microsoft.AspNetCore.Http;
  4. using Microsoft.AspNetCore.Identity;
  5. using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
  6. using Microsoft.EntityFrameworkCore;
  7. using Microsoft.EntityFrameworkCore.Infrastructure;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Text;
  11. using System.Threading;
  12. using System.Threading.Tasks;
  13. namespace Backend.Data.Config
  14. {
  15. public class ApplicationDatabaseContext : DbContext,IApplicationDatabaseContext
  16. {
  17. public ApplicationDatabaseContext(DbContextOptions<ApplicationDatabaseContext> options) : base(options)
  18. {
  19. }
  20. protected override void OnModelCreating(ModelBuilder builder)
  21. {
  22. base.OnModelCreating(builder);
  23. }
  24. public DbSet<Produit> Produits { get; set; }
  25. public DbSet<Propriete> Proprietes { get; set; }
  26. public DbSet<TypePropriete> TypeProprietes { get; set; }
  27. public DbSet<Commande> Commandes { get; set; }
  28. public DbSet<LigneCommande> LigneCommandes { get; set; }
  29. public override async Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
  30. {
  31. return await base.SaveChangesAsync(cancellationToken);
  32. }
  33. }
  34. }

Powered by TurnKey Linux.