ApplicationDbContext.cs 767 B

12345678910111213141516171819202122
  1. using ConcursoProjetos.Domain.Entities;
  2. using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore;
  4. namespace ConcursoProjetos.Data;
  5. public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : IdentityDbContext<ApplicationUser>(options)
  6. {
  7. public DbSet<Candidato> Candidato => Set<Candidato>();
  8. public DbSet<Projeto> Projeto => Set<Projeto>();
  9. public DbSet<Documento> Documento => Set<Documento>();
  10. public DbSet<TipoDocumento> TipoDocumento => Set<TipoDocumento>();
  11. protected override void OnModelCreating(ModelBuilder modelBuilder)
  12. {
  13. modelBuilder.ApplyConfigurationsFromAssembly(typeof(ApplicationDbContext).Assembly);
  14. base.OnModelCreating(modelBuilder);
  15. }
  16. }