From c84e37427490fad6fef4a251eebff2d121d7cee8 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sat, 27 Mar 2021 18:54:25 -0500 Subject: [PATCH] fix issue with client api for issue #191 --- SharedLibraryCore/Services/ClientService.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/SharedLibraryCore/Services/ClientService.cs b/SharedLibraryCore/Services/ClientService.cs index 8180f61af..3544aa4e4 100644 --- a/SharedLibraryCore/Services/ClientService.cs +++ b/SharedLibraryCore/Services/ClientService.cs @@ -728,21 +728,19 @@ namespace SharedLibraryCore.Services var result = new ResourceQueryHelperResult(); await using var context = _contextFactory.CreateContext(enableTracking: false); - IQueryable iqClients = null; + IQueryable iqClients = null; if (!string.IsNullOrEmpty(query.Xuid)) { - long networkId = query.Xuid.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber); - iqClients = context.Clients. - Where(_client => _client.NetworkId == networkId) - .Select(client => client.ToPartialClient()); + var networkId = query.Xuid.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber); + iqClients = context.Clients.Where(_client => _client.NetworkId == networkId); } else if (!string.IsNullOrEmpty(query.Name)) { iqClients = context.Clients - .Where(_client => EF.Functions.Like(_client.CurrentAlias.Name.ToLower(), $"%{query.Name.ToLower()}%")) - .Select(client => client.ToPartialClient()); + .Where(_client => + EF.Functions.Like(_client.CurrentAlias.Name.ToLower(), $"%{query.Name.ToLower()}%")); } if (query.Direction == SortDirection.Ascending)