mirror of
https://github.com/guilhermewerner/gerencia-projetos
synced 2025-06-16 23:15:05 +00:00
Context
This commit is contained in:
@ -7,7 +7,7 @@ using GerenciaProjetos.Models;
|
||||
|
||||
namespace GerenciaProjetos.Data
|
||||
{
|
||||
public class AppContext : DbContext
|
||||
public class GerenciaContext : DbContext
|
||||
{
|
||||
public DbSet<Bug> Bugs { get; set; }
|
||||
public DbSet<Desenvolvedor> Desenvolvedores { get; set; }
|
||||
@ -17,7 +17,7 @@ namespace GerenciaProjetos.Data
|
||||
public DbSet<DesenvolvedorProjeto> DesenvolvedorProjeto { get; set; }
|
||||
public DbSet<DesenvolvedorRequisito> DesenvolvedorRequisito { get; set; }
|
||||
|
||||
public AppContext(DbContextOptions o) : base(o)
|
||||
public GerenciaContext(DbContextOptions o) : base(o)
|
||||
{
|
||||
|
||||
}
|
||||
@ -25,11 +25,11 @@ namespace GerenciaProjetos.Data
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Bug>()
|
||||
.HasKey(c => new { c.DesenvolvedorId, c.RequisitoId });
|
||||
.HasKey(b => new { b.DesenvolvedorId, b.RequisitoId });
|
||||
modelBuilder.Entity<DesenvolvedorProjeto>()
|
||||
.HasKey(c => new { c.DesenvolvedorId, c.ProjetoId });
|
||||
.HasKey(p => new { p.DesenvolvedorId, p.ProjetoId });
|
||||
modelBuilder.Entity<DesenvolvedorRequisito>()
|
||||
.HasKey(c => new { c.DesenvolvedorId, c.RequisitoId });
|
||||
.HasKey(r => new { r.DesenvolvedorId, r.RequisitoId });
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user