Feature/character creator
This commit is contained in:
@@ -31,5 +31,19 @@ namespace reallife_gamemode.Server.Extensions
|
||||
return context.UserBankAccounts.FirstOrDefault(u => u.UserId == user.Id);
|
||||
}
|
||||
}
|
||||
public static Character GetUserCharacter(this User user, DatabaseContext context = null)
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
using (context = new DatabaseContext())
|
||||
{
|
||||
return context.Characters.FirstOrDefault(u => u.UserId == user.Id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return context.Characters.FirstOrDefault(u => u.UserId == user.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user