Mostly backend models stuff

Changed some models, did some work on database, created a class diagram.
This commit is contained in:
Nadegamra
2021-09-08 20:20:32 +03:00
parent 3e82ea9392
commit a3b4bb2e30
11 changed files with 105 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using KTUSAPS.Data.Model;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -13,7 +14,8 @@ namespace KTUSAPS.Data
public SAPSDataContext(DbContextOptions options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Vote>()
.HasKey(v => new { v.UserId, v.ProblemId });
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
@@ -24,6 +26,11 @@ namespace KTUSAPS.Data
}
}
public DbSet<Issue> Issues { get; set; }
public DbSet<PublishedFeedback> PublishedFeedbacks { get; set; }
public DbSet<PublishedProblem> PublishedProblems { get; set; }
public DbSet<Solution> Solutions { get; set; }
public DbSet<Vote> Votes { get; set; }
}
}