From ab21257fb5a08553d88f05f3199d6ca8b8836a63 Mon Sep 17 00:00:00 2001 From: harlam357 Date: Sun, 22 May 2022 18:35:03 -0500 Subject: [PATCH] Revert "fix(ef-core): verify Client.Guid is not null before parsing" This reverts commit 179a977d920dbf016e67a371d4a1591e16119c33. --- src/HFM.Core/Data/ProteinBenchmarkRepository.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/HFM.Core/Data/ProteinBenchmarkRepository.cs b/src/HFM.Core/Data/ProteinBenchmarkRepository.cs index da6b6ed4..e0e4c3df 100644 --- a/src/HFM.Core/Data/ProteinBenchmarkRepository.cs +++ b/src/HFM.Core/Data/ProteinBenchmarkRepository.cs @@ -183,9 +183,8 @@ public async Task> GetBenchmarksAsync(SlotIdentifi public async Task> GetBenchmarksAsync(SlotIdentifier slotIdentifier, IEnumerable projects) => await GetBenchmarksAsync(slotIdentifier, projects, null).ConfigureAwait(false); - private async Task> GetBenchmarksAsync(SlotIdentifier slotIdentifier, IEnumerable projects, int? count) - { - var query = await QueryWorkUnitsByClientSlot(slotIdentifier, _context) + private async Task> GetBenchmarksAsync(SlotIdentifier slotIdentifier, IEnumerable projects, int? count) => + (await QueryWorkUnitsByClientSlot(slotIdentifier, _context) .Include(x => x.Protein) .Include(x => x.Client) .Include(x => x.Platform) @@ -194,13 +193,11 @@ private async Task> GetBenchmarksAsync(SlotIdentif .OrderByDescending(y => y.FrameID)) .Where(x => projects.Contains(x.Protein.ProjectID) && x.Frames.Any()) .OrderByDescending(x => x.ID) - .ToListAsync().ConfigureAwait(false); - - return query + .ToListAsync().ConfigureAwait(false)) .GroupBy(x => (SlotIdentifier: new SlotIdentifier( ClientIdentifier.FromConnectionString( - x.Client.Name, x.Client.ConnectionString, x.Client.Guid is null ? Guid.Empty : Guid.Parse(x.Client.Guid)), + x.Client.Name, x.Client.ConnectionString, Guid.Parse(x.Client.Guid)), x.ClientSlot ?? SlotIdentifier.NoSlotID), BenchmarkIdentifier: new ProteinBenchmarkIdentifier( x.Protein.ProjectID, x.Platform?.Processor, x.Platform?.Threads ?? ProteinBenchmarkIdentifier.NoThreads))) @@ -222,7 +219,6 @@ private async Task> GetBenchmarksAsync(SlotIdentif }) .TakeWhile((_, i) => !count.HasValue || i < count) .ToList(); - } private static IQueryable QueryWorkUnitsByClientSlot(SlotIdentifier slotIdentifier, WorkUnitContext context) {