Makes sure the nucache is not truncated when its null (#14395)

* Makes sure the nucache is not truncated when its null
* Removed parentheses

(cherry picked from commit 0a4a938b88)
This commit is contained in:
Mads Mørch Schou
2023-06-16 19:22:39 +02:00
committed by Sebastiaan Janssen
parent ebe375d23b
commit 76ad99beb0

View File

@@ -109,9 +109,9 @@ public class NuCacheContentRepository : RepositoryBase, INuCacheContentRepositor
| ContentCacheDataSerializerEntityType.Member);
// If contentTypeIds, mediaTypeIds and memberTypeIds are null, truncate table as all records will be deleted (as these 3 are the only types in the table).
if ((contentTypeIds == null || !contentTypeIds.Any())
&& (mediaTypeIds == null || !mediaTypeIds.Any())
&& (memberTypeIds == null || !memberTypeIds.Any()))
if (contentTypeIds != null && !contentTypeIds.Any()
&& mediaTypeIds != null && !mediaTypeIds.Any()
&& memberTypeIds != null && !memberTypeIds.Any())
{
if (Database.DatabaseType == DatabaseType.SqlServer2012)
{