Files
reallife-gamemode/ReallifeGamemode.Server/Extensions/HouseExtensions.cs
2019-07-17 19:52:55 +02:00

22 lines
524 B
C#

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.Owner).FirstOrDefault();
}
}
}
}