Mostly backend models stuff
Changed some models, did some work on database, created a class diagram.
This commit is contained in:
@@ -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; }
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user