1
- namespace ToSic . Eav . Repository . Efc . Parts ;
1
+ using System . Linq ;
2
+
3
+ namespace ToSic . Eav . Repository . Efc . Parts ;
2
4
3
5
partial class DbEntity
4
6
{
@@ -35,15 +37,19 @@ internal ToSicEavEntities GetDbEntity(int entityId)
35
37
internal ToSicEavEntities [ ] GetDbEntities ( int [ ] repositoryIds )
36
38
{
37
39
var callLog = DbContext . Log . Fn < ToSicEavEntities [ ] > ( $ "Get { repositoryIds . Length } ", timer : true ) ;
38
- var found = EntityQuery . Where ( e => repositoryIds . Contains ( e . EntityId ) ) . ToArray ( ) ;
40
+ // commented because of https://github.com/npgsql/efcore.pg/issues/3461, we can go back with net10.0
41
+ // var found = EntityQuery.Where(e => repositoryIds.Contains(e.EntityId)).ToArray();
42
+ var found = EntityQuery . Where ( e => Enumerable . Contains ( repositoryIds , e . EntityId ) ) . ToArray ( ) ;
39
43
return callLog . Return ( found , found . Length . ToString ( ) ) ;
40
44
}
41
45
42
46
//private ToSicEavEntities GetDbEntity(int entityId, string includes)
43
47
// => IncludeMultiple(EntityQuery, includes).Single(e => e.EntityId == entityId);
44
48
45
49
private List < ToSicEavEntities > GetDbEntities ( int [ ] entityIds , string includes )
46
- => IncludeMultiple ( EntityQuery , includes ) . Where ( e => entityIds . Contains ( e . EntityId ) ) . ToList ( ) ;
50
+ // commented because of https://github.com/npgsql/efcore.pg/issues/3461, we can go back with net10.0
51
+ // => IncludeMultiple(EntityQuery, includes).Where(e => entityIds.Contains(e.EntityId)).ToList();
52
+ => IncludeMultiple ( EntityQuery , includes ) . Where ( e => Enumerable . Contains ( entityIds , e . EntityId ) ) . ToList ( ) ;
47
53
48
54
private static IQueryable < ToSicEavEntities > IncludeMultiple ( IQueryable < ToSicEavEntities > origQuery , string additionalTables )
49
55
{
@@ -68,7 +74,9 @@ internal IQueryable<ToSicEavEntities> GetEntitiesByGuid(Guid entityGuid)
68
74
=> EntityQuery . Where ( e => e . EntityGuid == entityGuid
69
75
&& ! e . ChangeLogDeleted . HasValue
70
76
&& ! e . AttributeSet . ChangeLogDeleted . HasValue
71
- && DbContext . AppIds . Contains ( e . AppId ) ) ;
77
+ // commented because of https://github.com/npgsql/efcore.pg/issues/3461, we can go back with net10.0
78
+ // && DbContext.AppIds.Contains(e.AppId));
79
+ && Enumerable . Contains ( DbContext . AppIds , e . AppId ) ) ;
72
80
73
81
/// <summary>
74
82
/// Get a single Entity by EntityGuid. Ensure it's not deleted and has context's AppId
@@ -105,10 +113,15 @@ internal Dictionary<Guid, int> GetMostCurrentDbEntities(Guid[] entityGuids)
105
113
// 2020-10-07 2dm experiment with fewer requests
106
114
internal IQueryable < ToSicEavEntities > GetEntitiesByGuid ( Guid [ ] entityGuid )
107
115
=> EntityQuery
108
- . Where ( e => entityGuid . Contains ( e . EntityGuid )
116
+ . Where ( e =>
117
+ // commented because of https://github.com/npgsql/efcore.pg/issues/3461, we can go back with net10.0
118
+ // entityGuid.Contains(e.EntityGuid)
119
+ Enumerable . Contains ( entityGuid , e . EntityGuid )
109
120
&& e . ChangeLogDeleted == null
110
121
&& e . AttributeSet . ChangeLogDeleted == null
111
- && DbContext . AppIds . Contains ( e . AppId )
122
+ // commented because of https://github.com/npgsql/efcore.pg/issues/3461, we can go back with net10.0
123
+ // && DbContext.AppIds.Contains(e.AppId)
124
+ && Enumerable . Contains ( DbContext . AppIds , e . AppId )
112
125
) ;
113
126
114
127
0 commit comments