qol: inline variable declaration
This commit is contained in:
@@ -31,8 +31,7 @@ namespace Disco.Services.Users.UserFlags
|
||||
|
||||
public UserFlag GetUserFlag(int UserFlagId)
|
||||
{
|
||||
UserFlag item;
|
||||
if (_Cache.TryGetValue(UserFlagId, out item))
|
||||
if (_Cache.TryGetValue(UserFlagId, out var item))
|
||||
return item;
|
||||
else
|
||||
return null;
|
||||
@@ -49,8 +48,7 @@ namespace Disco.Services.Users.UserFlags
|
||||
|
||||
public UserFlag Remove(int UserFlagId)
|
||||
{
|
||||
UserFlag item;
|
||||
if (_Cache.TryRemove(UserFlagId, out item))
|
||||
if (_Cache.TryRemove(UserFlagId, out var item))
|
||||
return item;
|
||||
else
|
||||
return null;
|
||||
|
||||
@@ -57,10 +57,9 @@ namespace Disco.Services.Users.UserFlags
|
||||
|
||||
public static bool TryGetManagedGroup(UserFlag UserFlag, out UserFlagUserDevicesManagedGroup ManagedGroup)
|
||||
{
|
||||
ADManagedGroup managedGroup;
|
||||
string key = GetKey(UserFlag);
|
||||
|
||||
if (ActiveDirectory.Context.ManagedGroups.TryGetValue(key, out managedGroup))
|
||||
if (ActiveDirectory.Context.ManagedGroups.TryGetValue(key, out var managedGroup))
|
||||
{
|
||||
ManagedGroup = (UserFlagUserDevicesManagedGroup)managedGroup;
|
||||
return true;
|
||||
|
||||
@@ -57,10 +57,9 @@ namespace Disco.Services.Users.UserFlags
|
||||
|
||||
public static bool TryGetManagedGroup(UserFlag UserFlag, out UserFlagUsersManagedGroup ManagedGroup)
|
||||
{
|
||||
ADManagedGroup managedGroup;
|
||||
string key = GetKey(UserFlag);
|
||||
|
||||
if (ActiveDirectory.Context.ManagedGroups.TryGetValue(key, out managedGroup))
|
||||
if (ActiveDirectory.Context.ManagedGroups.TryGetValue(key, out var managedGroup))
|
||||
{
|
||||
ManagedGroup = (UserFlagUsersManagedGroup)managedGroup;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user