using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using GerenciaProjetos.Models; namespace GerenciaProjetos.Data { public class AppContext : DbContext { public DbSet Bugs { get; set; } public DbSet Desenvolvedores { get; set; } public DbSet Projetos { get; set; } public DbSet Requisitos { get; set; } public DbSet DesenvolvedorProjeto { get; set; } public DbSet DesenvolvedorRequisito { get; set; } public AppContext(DbContextOptions o) : base(o) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() .HasKey(c => new { c.DesenvolvedorId, c.RequisitoId }); modelBuilder.Entity() .HasKey(c => new { c.DesenvolvedorId, c.ProjetoId }); modelBuilder.Entity() .HasKey(c => new { c.DesenvolvedorId, c.RequisitoId }); } } }