Add Header Comments, Add 'null'-Checks on Commands
This commit is contained in:
@@ -3,17 +3,24 @@ using reallife_gamemode.Model;
|
||||
using reallife_gamemode.Server.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace reallife_gamemode.Server.Extensions
|
||||
{
|
||||
public static class ClientExtension
|
||||
{
|
||||
/**
|
||||
* @overview Life of German Reallife - Client Extension (ClientExtension.cs)
|
||||
* @author VegaZ, hydrant
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
public static User GetUser(this Client client)
|
||||
{
|
||||
using(DatabaseContext dbContext = new DatabaseContext())
|
||||
{
|
||||
return dbContext.Users.Find(client.Name);
|
||||
return dbContext.Users.FirstOrDefault(u => u.Name == client.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user