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