Faction is not null on Client.GetUser() anymore
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using GTANetworkAPI;
|
using GTANetworkAPI;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using ReallifeGamemode.Server.Entities;
|
using ReallifeGamemode.Server.Entities;
|
||||||
using ReallifeGamemode.Server.Models;
|
using ReallifeGamemode.Server.Models;
|
||||||
using System;
|
using System;
|
||||||
@@ -28,12 +29,20 @@ namespace ReallifeGamemode.Server.Extensions
|
|||||||
{
|
{
|
||||||
using (context = new DatabaseContext())
|
using (context = new DatabaseContext())
|
||||||
{
|
{
|
||||||
return context.Users.FirstOrDefault(u => u.Name == client.Name);
|
return context
|
||||||
|
.Users
|
||||||
|
.Include(u => u.Faction)
|
||||||
|
.Include(u => u.FactionRank)
|
||||||
|
.FirstOrDefault(u => u.Name == client.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return context.Users.FirstOrDefault(u => u.Name == client.Name);
|
return context
|
||||||
|
.Users
|
||||||
|
.Include(u => u.Faction)
|
||||||
|
.Include(u => u.FactionRank)
|
||||||
|
.FirstOrDefault(u => u.Name == client.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user