add house reload command
This commit is contained in:
21
ReallifeGamemode.Server/Extensions/HouseExtensions.cs
Normal file
21
ReallifeGamemode.Server/Extensions/HouseExtensions.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user