From ed9f31df1f6d00b4b2b9e5cc3225e6b3eb95245d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Tue, 24 Jan 2023 18:59:03 +0100 Subject: [PATCH] [WIP] Add additional check to entities list --- src/Connected.Entities/Caching/EntityCacheClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Connected.Entities/Caching/EntityCacheClient.cs b/src/Connected.Entities/Caching/EntityCacheClient.cs index 9b20564..36dea51 100644 --- a/src/Connected.Entities/Caching/EntityCacheClient.cs +++ b/src/Connected.Entities/Caching/EntityCacheClient.cs @@ -82,7 +82,9 @@ public abstract class EntityCacheClient : StatefulCacheCli if (context.GetService() is not IStorageProvider provider) return default; - var entities = provider.Open().AsEntities(); + var entities = await provider.Open().AsEntities(); + + var entity = entities.FirstOrDefault(e => e.Id.Equals(id)); return await (from dc in provider.Open() where TypeComparer.Compare(dc.Id, id)