Skip to content

Commit

Permalink
Add MitternachtContext as the new default context using Npgsql as the…
Browse files Browse the repository at this point in the history
… database provider, add data migration from NadekoContext.
  • Loading branch information
expeehaa committed Jul 3, 2020
1 parent 24d4dea commit dbf8015
Show file tree
Hide file tree
Showing 12 changed files with 6,578 additions and 22 deletions.
2 changes: 1 addition & 1 deletion MitternachtWeb/Areas/Guild/Controllers/QuotesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public QuotesController(DbService db) {
public IActionResult Index() {
if(PermissionReadQuotes) {
using var uow = _db.UnitOfWork;
var quotes = uow.Quotes.GetAllForGuild(GuildId).Select(q => {
var quotes = uow.Quotes.GetAllForGuild(GuildId).ToList().Select(q => {
var user = Guild.GetUser(q.AuthorId);

return new Quote {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public VerificationsController(DbService db) {
public IActionResult Index() {
if(PermissionReadVerifications) {
using var uow = _db.UnitOfWork;
var verifications = uow.VerifiedUsers.GetVerifiedUsers(GuildId).Select(v => {
var verifications = uow.VerifiedUsers.GetVerifiedUsers(GuildId).ToList().Select(v => {
var user = Guild.GetUser(v.UserId);

return new Verification {
Expand Down
2 changes: 1 addition & 1 deletion MitternachtWeb/Areas/Guild/Controllers/WarnsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public WarnsController(DbService db) {
public IActionResult Index() {
if(PermissionReadWarns) {
using var uow = _db.UnitOfWork;
var warns = uow.Warnings.GetForGuild(GuildId).Select((Func<Warning, Warn>)(w => {
var warns = uow.Warnings.GetForGuild(GuildId).ToList().Select((Func<Warning, Warn>)(w => {
var user = Guild.GetUser(w.UserId);

return new Warn {
Expand Down
Loading

0 comments on commit dbf8015

Please sign in to comment.