add house reload command

This commit is contained in:
hydrant
2019-06-27 19:33:05 +02:00
parent f2b1788939
commit c63c516757
3 changed files with 55 additions and 8 deletions

View File

@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore;
using ReallifeGamemode.Server.Entities;
using ReallifeGamemode.Server.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ReallifeGamemode.Server.Extensions
{
static class HouseExtensions
{
public static House Refresh(this House house)
{
using(var dbContext = new DatabaseContext())
{
return dbContext.Houses.Where(h => h.Id == house.Id).Include(h => h.User).FirstOrDefault();
}
}
}
}