diff --git a/zero.Core/Collections/CollectionBase.cs b/zero.Core/Collections/CollectionBase.cs
index 81a5fe3a..35a48101 100644
--- a/zero.Core/Collections/CollectionBase.cs
+++ b/zero.Core/Collections/CollectionBase.cs
@@ -402,7 +402,7 @@ namespace zero.Core.Collections
///
/// Do only return the model when it is set to active or inactive entities are included with IncludeInactive()
///
- protected T WhenActive(T model)
+ protected TRes WhenActive(TRes model) where TRes : T
{
return model != null && (!OnlyActive || model.IsActive) ? model : default;
}
diff --git a/zero.Core/Collections/Integrations/IntegrationsCollection.cs b/zero.Core/Collections/Integrations/IntegrationsCollection.cs
index 194e8a30..66840592 100644
--- a/zero.Core/Collections/Integrations/IntegrationsCollection.cs
+++ b/zero.Core/Collections/Integrations/IntegrationsCollection.cs
@@ -222,7 +222,7 @@ namespace zero.Core.Collections
entity.TypeAlias = type.Alias;
}
- return entity;
+ return WhenActive(entity);
}
}
diff --git a/zero.Core/Integrations/IntegrationService.cs b/zero.Core/Integrations/IntegrationService.cs
index 9e10d28f..ffb952b6 100644
--- a/zero.Core/Integrations/IntegrationService.cs
+++ b/zero.Core/Integrations/IntegrationService.cs
@@ -6,7 +6,10 @@ namespace zero.Core.Integrations
{
public class IntegrationService : IntegrationsCollection, IIntegrationService
{
- public IntegrationService(IZeroOptions options, IZeroContext context, ILogger logger, ICollectionInterceptorHandler interceptorHandler = null) : base(context, options, logger, interceptorHandler) { }
+ public IntegrationService(IZeroOptions options, IZeroContext context, ILogger logger, ICollectionInterceptorHandler interceptorHandler = null) : base(context, options, logger, interceptorHandler)
+ {
+ OnlyActive = true;
+ }
}