diff --git a/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs index 7940c75e5..c0efcc7bc 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs @@ -23,8 +23,6 @@ namespace Squidex.Extensions.Actions.Comment public CommentActionHandler(RuleEventFormatter formatter, ICommandBus commandBus) : base(formatter) { - Guard.NotNull(commandBus, nameof(commandBus)); - this.commandBus = commandBus; } diff --git a/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs index c53bb0fe7..1a5996b8e 100644 --- a/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs @@ -30,10 +30,6 @@ namespace Squidex.Extensions.Actions.CreateContent public CreateContentActionHandler(RuleEventFormatter formatter, IAppProvider appProvider, ICommandBus commandBus, IJsonSerializer jsonSerializer) : base(formatter) { - Guard.NotNull(appProvider, nameof(appProvider)); - Guard.NotNull(commandBus, nameof(commandBus)); - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - this.appProvider = appProvider; this.commandBus = commandBus; this.jsonSerializer = jsonSerializer; diff --git a/backend/extensions/Squidex.Extensions/Actions/Fastly/FastlyActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Fastly/FastlyActionHandler.cs index cceb64de4..a28425109 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Fastly/FastlyActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Fastly/FastlyActionHandler.cs @@ -24,8 +24,6 @@ namespace Squidex.Extensions.Actions.Fastly public FastlyActionHandler(RuleEventFormatter formatter, IHttpClientFactory httpClientFactory) : base(formatter) { - Guard.NotNull(httpClientFactory, nameof(httpClientFactory)); - this.httpClientFactory = httpClientFactory; } diff --git a/backend/extensions/Squidex.Extensions/Actions/Notification/NotificationActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Notification/NotificationActionHandler.cs index 7089cff5d..890d58239 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Notification/NotificationActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Notification/NotificationActionHandler.cs @@ -27,9 +27,6 @@ namespace Squidex.Extensions.Actions.Notification public NotificationActionHandler(RuleEventFormatter formatter, ICommandBus commandBus, IUserResolver userResolver) : base(formatter) { - Guard.NotNull(commandBus, nameof(commandBus)); - Guard.NotNull(userResolver, nameof(userResolver)); - this.commandBus = commandBus; this.userResolver = userResolver; diff --git a/backend/extensions/Squidex.Extensions/Actions/Slack/SlackActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Slack/SlackActionHandler.cs index 303087488..36b55a3ec 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Slack/SlackActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Slack/SlackActionHandler.cs @@ -12,7 +12,6 @@ using System.Threading; using System.Threading.Tasks; using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.Rules.EnrichedEvents; -using Squidex.Infrastructure; namespace Squidex.Extensions.Actions.Slack { @@ -25,8 +24,6 @@ namespace Squidex.Extensions.Actions.Slack public SlackActionHandler(RuleEventFormatter formatter, IHttpClientFactory httpClientFactory) : base(formatter) { - Guard.NotNull(httpClientFactory, nameof(httpClientFactory)); - this.httpClientFactory = httpClientFactory; } diff --git a/backend/extensions/Squidex.Extensions/Actions/Twitter/TweetActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Twitter/TweetActionHandler.cs index 38f3f0844..54ba308c2 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Twitter/TweetActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Twitter/TweetActionHandler.cs @@ -12,7 +12,6 @@ using CoreTweet; using Microsoft.Extensions.Options; using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.Rules.EnrichedEvents; -using Squidex.Infrastructure; namespace Squidex.Extensions.Actions.Twitter { @@ -25,8 +24,6 @@ namespace Squidex.Extensions.Actions.Twitter public TweetActionHandler(RuleEventFormatter formatter, IOptions twitterOptions) : base(formatter) { - Guard.NotNull(twitterOptions, nameof(twitterOptions)); - this.twitterOptions = twitterOptions.Value; } diff --git a/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs index 031a92efc..f69eea162 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Webhook/WebhookActionHandler.cs @@ -23,8 +23,6 @@ namespace Squidex.Extensions.Actions.Webhook public WebhookActionHandler(RuleEventFormatter formatter, IHttpClientFactory httpClientFactory) : base(formatter) { - Guard.NotNull(httpClientFactory, nameof(httpClientFactory)); - this.httpClientFactory = httpClientFactory; } diff --git a/backend/extensions/Squidex.Extensions/Validation/CompositeUniqueValidatorFactory.cs b/backend/extensions/Squidex.Extensions/Validation/CompositeUniqueValidatorFactory.cs index 0ca427f3b..ad8d053a5 100644 --- a/backend/extensions/Squidex.Extensions/Validation/CompositeUniqueValidatorFactory.cs +++ b/backend/extensions/Squidex.Extensions/Validation/CompositeUniqueValidatorFactory.cs @@ -9,7 +9,6 @@ using System; using System.Collections.Generic; using Squidex.Domain.Apps.Core.ValidateContent; using Squidex.Domain.Apps.Entities.Contents.Repositories; -using Squidex.Infrastructure; namespace Squidex.Extensions.Validation { @@ -20,8 +19,6 @@ namespace Squidex.Extensions.Validation public CompositeUniqueValidatorFactory(IContentRepository contentRepository) { - Guard.NotNull(contentRepository, nameof(contentRepository)); - this.contentRepository = contentRepository; } diff --git a/backend/src/Migrations/RebuildRunner.cs b/backend/src/Migrations/RebuildRunner.cs index 175dc724a..4f83184e7 100644 --- a/backend/src/Migrations/RebuildRunner.cs +++ b/backend/src/Migrations/RebuildRunner.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.Options; using Migrations.Migrations; using Squidex.Domain.Apps.Entities.Assets; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; namespace Migrations @@ -28,11 +27,6 @@ namespace Migrations RebuildFiles rebuildFiles, PopulateGrainIndexes populateGrainIndexes) { - Guard.NotNull(rebuildFiles, nameof(rebuildFiles)); - Guard.NotNull(rebuilder, nameof(rebuilder)); - Guard.NotNull(rebuildOptions, nameof(rebuildOptions)); - Guard.NotNull(populateGrainIndexes, nameof(populateGrainIndexes)); - this.rebuildFiles = rebuildFiles; this.rebuilder = rebuilder; this.rebuildOptions = rebuildOptions.Value; diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventEnricher.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventEnricher.cs index 29688c57d..08e332756 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventEnricher.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventEnricher.cs @@ -24,9 +24,6 @@ namespace Squidex.Domain.Apps.Core.HandleRules public EventEnricher(IMemoryCache userCache, IUserResolver userResolver) { - Guard.NotNull(userCache, nameof(userCache)); - Guard.NotNull(userResolver, nameof(userResolver)); - this.userCache = userCache; this.userResolver = userResolver; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventJsonSchemaGenerator.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventJsonSchemaGenerator.cs index b2de217b0..ad9c68637 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventJsonSchemaGenerator.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/EventJsonSchemaGenerator.cs @@ -26,8 +26,6 @@ namespace Squidex.Domain.Apps.Core.HandleRules public EventJsonSchemaGenerator(JsonSchemaGenerator schemaGenerator) { - Guard.NotNull(schemaGenerator, nameof(schemaGenerator)); - this.schemaGenerator = schemaGenerator; schemas = new Lazy>(GenerateSchemas); diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/Extensions/EventFluidExtensions.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/Extensions/EventFluidExtensions.cs index a21bb7a24..9569596dc 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/Extensions/EventFluidExtensions.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/Extensions/EventFluidExtensions.cs @@ -20,8 +20,6 @@ namespace Squidex.Domain.Apps.Core.HandleRules.Extensions public EventFluidExtensions(IUrlGenerator urlGenerator) { - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.urlGenerator = urlGenerator; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/Extensions/EventJintExtension.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/Extensions/EventJintExtension.cs index 1536ec15a..5589edf3c 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/Extensions/EventJintExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/Extensions/EventJintExtension.cs @@ -8,7 +8,6 @@ using Jint.Native; using Squidex.Domain.Apps.Core.Rules.EnrichedEvents; using Squidex.Domain.Apps.Core.Scripting; -using Squidex.Infrastructure; using Squidex.Text; namespace Squidex.Domain.Apps.Core.HandleRules.Extensions @@ -20,8 +19,6 @@ namespace Squidex.Domain.Apps.Core.HandleRules.Extensions public EventJintExtension(IUrlGenerator urlGenerator) { - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.urlGenerator = urlGenerator; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/PredefinedPatternsFormatter.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/PredefinedPatternsFormatter.cs index 62a739c3a..040f5f484 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/PredefinedPatternsFormatter.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/PredefinedPatternsFormatter.cs @@ -9,7 +9,6 @@ using System; using System.Collections.Generic; using System.Globalization; using Squidex.Domain.Apps.Core.Rules.EnrichedEvents; -using Squidex.Infrastructure; using Squidex.Shared.Identity; using Squidex.Text; @@ -22,8 +21,6 @@ namespace Squidex.Domain.Apps.Core.HandleRules public PredefinedPatternsFormatter(IUrlGenerator urlGenerator) { - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.urlGenerator = urlGenerator; AddPattern("APP_ID", AppId); diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleActionHandler.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleActionHandler.cs index f02736b59..197875e53 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleActionHandler.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleActionHandler.cs @@ -10,7 +10,6 @@ using System.Threading; using System.Threading.Tasks; using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules.EnrichedEvents; -using Squidex.Infrastructure; #pragma warning disable RECS0083 // Shows NotImplementedException throws in the quick task bar @@ -32,8 +31,6 @@ namespace Squidex.Domain.Apps.Core.HandleRules protected RuleActionHandler(RuleEventFormatter formatter) { - Guard.NotNull(formatter, nameof(formatter)); - this.formatter = formatter; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs index 548cc1822..e73b04bd0 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleEventFormatter.cs @@ -16,7 +16,6 @@ using NodaTime.Text; using Squidex.Domain.Apps.Core.Rules.EnrichedEvents; using Squidex.Domain.Apps.Core.Scripting; using Squidex.Domain.Apps.Core.Templates; -using Squidex.Infrastructure; using Squidex.Infrastructure.Json; using Squidex.Text; using ValueTaskSupplement; @@ -72,11 +71,6 @@ namespace Squidex.Domain.Apps.Core.HandleRules public RuleEventFormatter(IJsonSerializer jsonSerializer, IEnumerable formatters, ITemplateEngine templateEngine, IScriptEngine scriptEngine) { - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - Guard.NotNull(scriptEngine, nameof(scriptEngine)); - Guard.NotNull(templateEngine, nameof(templateEngine)); - Guard.NotNull(formatters, nameof(formatters)); - this.jsonSerializer = jsonSerializer; this.formatters = formatters; this.templateEngine = templateEngine; diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleService.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleService.cs index 6549b9d0e..913b3aea8 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleService.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/HandleRules/RuleService.cs @@ -46,15 +46,6 @@ namespace Squidex.Domain.Apps.Core.HandleRules ISemanticLog log, TypeNameRegistry typeNameRegistry) { - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - Guard.NotNull(ruleOptions, nameof(ruleOptions)); - Guard.NotNull(ruleTriggerHandlers, nameof(ruleTriggerHandlers)); - Guard.NotNull(ruleActionHandlers, nameof(ruleActionHandlers)); - Guard.NotNull(typeNameRegistry, nameof(typeNameRegistry)); - Guard.NotNull(eventEnricher, nameof(eventEnricher)); - Guard.NotNull(clock, nameof(clock)); - Guard.NotNull(log, nameof(log)); - this.typeNameRegistry = typeNameRegistry; this.ruleOptions = ruleOptions.Value; diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Extensions/HttpJintExtension.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Extensions/HttpJintExtension.cs index 8f25001ad..76f0a9f2f 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Extensions/HttpJintExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Extensions/HttpJintExtension.cs @@ -12,7 +12,6 @@ using Jint; using Jint.Native; using Jint.Native.Json; using Jint.Runtime; -using Squidex.Infrastructure; using Squidex.Infrastructure.Tasks; namespace Squidex.Domain.Apps.Core.Scripting.Extensions @@ -24,8 +23,6 @@ namespace Squidex.Domain.Apps.Core.Scripting.Extensions public HttpJintExtension(IHttpClientFactory httpClientFactory) { - Guard.NotNull(httpClientFactory, nameof(httpClientFactory)); - this.httpClientFactory = httpClientFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/Parser.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/Parser.cs index 0e01d4153..7c6e2ccc5 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/Parser.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/Internal/Parser.cs @@ -25,8 +25,6 @@ namespace Squidex.Domain.Apps.Core.Scripting.Internal public Parser(IMemoryCache cache) { - Guard.NotNull(cache, nameof(cache)); - this.cache = cache; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Templates/FluidTemplateEngine.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Templates/FluidTemplateEngine.cs index d34f4d2de..0b630e123 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Templates/FluidTemplateEngine.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Templates/FluidTemplateEngine.cs @@ -57,8 +57,6 @@ namespace Squidex.Domain.Apps.Core.Templates public FluidTemplateEngine(IEnumerable extensions) { - Guard.NotNull(extensions, nameof(extensions)); - this.extensions = extensions; SquidexTemplate.Setup(extensions); diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository.cs index f42f765d8..51ea67dea 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository.cs @@ -36,8 +36,6 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider) { - Guard.NotNull(appProvider, nameof(appProvider)); - collectionAll = new MongoContentCollection("States_Contents_All3", database, appProvider, ReadPreference.Primary); diff --git a/backend/src/Squidex.Domain.Apps.Entities/AppProvider.cs b/backend/src/Squidex.Domain.Apps.Entities/AppProvider.cs index 34243d69f..315961928 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/AppProvider.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/AppProvider.cs @@ -31,11 +31,6 @@ namespace Squidex.Domain.Apps.Entities public AppProvider(ILocalCache localCache, IAppsIndex indexForApps, IRulesIndex indexRules, ISchemasIndex indexSchemas) { - Guard.NotNull(indexForApps, nameof(indexForApps)); - Guard.NotNull(indexRules, nameof(indexRules)); - Guard.NotNull(indexSchemas, nameof(indexSchemas)); - Guard.NotNull(localCache, nameof(localCache)); - this.localCache = localCache; this.indexForApps = indexForApps; this.indexRules = indexRules; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppSettingsSearchSource.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppSettingsSearchSource.cs index 17138f2f7..117c3a2d1 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppSettingsSearchSource.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppSettingsSearchSource.cs @@ -22,8 +22,6 @@ namespace Squidex.Domain.Apps.Entities.Apps public AppSettingsSearchSource(IUrlGenerator urlGenerator) { - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.urlGenerator = urlGenerator; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettings.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettings.cs index 4fbfbbcc7..2a39b7427 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettings.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettings.cs @@ -19,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Apps public AppUISettings(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettingsGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettingsGrain.cs index ea6c18642..cd943b1ab 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettingsGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppUISettingsGrain.cs @@ -27,8 +27,6 @@ namespace Squidex.Domain.Apps.Entities.Apps public AppUISettingsGrain(IGrainState state) { - Guard.NotNull(state, nameof(state)); - this.state = state; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/BackupApps.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/BackupApps.cs index 7d6a1d6d1..89325c8f3 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/BackupApps.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/BackupApps.cs @@ -32,10 +32,6 @@ namespace Squidex.Domain.Apps.Entities.Apps public BackupApps(IAppImageStore appImageStore, IAppsIndex appsIndex, IAppUISettings appUISettings) { - Guard.NotNull(appImageStore, nameof(appImageStore)); - Guard.NotNull(appsIndex, nameof(appsIndex)); - Guard.NotNull(appUISettings, nameof(appUISettings)); - this.appsIndex = appsIndex; this.appImageStore = appImageStore; this.appUISettings = appUISettings; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppImageStore.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppImageStore.cs index 94b4be2da..ddf8f95e4 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppImageStore.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppImageStore.cs @@ -19,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Apps public DefaultAppImageStore(IAssetStore assetStore) { - Guard.NotNull(assetStore, nameof(assetStore)); - this.assetStore = assetStore; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppLogStore.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppLogStore.cs index 3ce41bc53..c678f6cf7 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppLogStore.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/DefaultAppLogStore.cs @@ -41,8 +41,6 @@ namespace Squidex.Domain.Apps.Entities.Apps public DefaultAppLogStore(IRequestLogStore requestLogStore) { - Guard.NotNull(requestLogStore, nameof(requestLogStore)); - this.requestLogStore = requestLogStore; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Diagnostics/OrleansAppsHealthCheck.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Diagnostics/OrleansAppsHealthCheck.cs index 2ba4138f9..9a61bbcd7 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Diagnostics/OrleansAppsHealthCheck.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Diagnostics/OrleansAppsHealthCheck.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.Diagnostics.HealthChecks; using Orleans; using Squidex.Domain.Apps.Entities.Apps.Indexes; -using Squidex.Infrastructure; using Squidex.Infrastructure.Orleans; namespace Squidex.Domain.Apps.Entities.Apps.Diagnostics @@ -21,8 +20,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.Diagnostics public OrleansAppsHealthCheck(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppCommandMiddleware.cs index 9317e2281..b24400e06 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppCommandMiddleware.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Orleans; using Squidex.Assets; using Squidex.Domain.Apps.Entities.Apps.Commands; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Translations; using Squidex.Infrastructure.Validation; @@ -29,10 +28,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject IContextProvider contextProvider) : base(grainFactory) { - Guard.NotNull(contextProvider, nameof(contextProvider)); - Guard.NotNull(appImageStore, nameof(appImageStore)); - Guard.NotNull(assetThumbnailGenerator, nameof(assetThumbnailGenerator)); - this.appImageStore = appImageStore; this.assetThumbnailGenerator = assetThumbnailGenerator; this.contextProvider = contextProvider; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppDomainObject.cs index 64e39e953..107896161 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/DomainObject/AppDomainObject.cs @@ -38,11 +38,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.DomainObject IUserResolver userResolver) : base(persistence, log) { - Guard.NotNull(initialPatterns, nameof(initialPatterns)); - Guard.NotNull(userResolver, nameof(userResolver)); - Guard.NotNull(appPlansProvider, nameof(appPlansProvider)); - Guard.NotNull(appPlansBillingManager, nameof(appPlansBillingManager)); - this.userResolver = userResolver; this.appPlansProvider = appPlansProvider; this.appPlansBillingManager = appPlansBillingManager; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs index a1ca8c570..995007747 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs @@ -33,9 +33,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.Indexes public AppsIndex(IGrainFactory grainFactory, IReplicatedCache grainCache) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - Guard.NotNull(grainCache, nameof(grainCache)); - this.grainFactory = grainFactory; this.grainCache = grainCache; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs index b76038828..9b60f4ec9 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using NodaTime; using Squidex.Domain.Apps.Entities.Notifications; using Squidex.Domain.Apps.Events.Apps; -using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Squidex.Log; using Squidex.Shared.Users; @@ -35,10 +34,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.Invitation public InvitationEventConsumer(INotificationSender emailSender, IUserResolver userResolver, ISemanticLog log) { - Guard.NotNull(emailSender, nameof(emailSender)); - Guard.NotNull(userResolver, nameof(userResolver)); - Guard.NotNull(log, nameof(log)); - this.emailSender = emailSender; this.userResolver = userResolver; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs index 2aa9912ef..9d2653d7f 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InviteUserCommandMiddleware.cs @@ -19,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.Invitation public InviteUserCommandMiddleware(IUserResolver userResolver) { - Guard.NotNull(userResolver, nameof(userResolver)); - this.userResolver = userResolver; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/ConfigAppPlansProvider.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/ConfigAppPlansProvider.cs index 3a039ca46..380e90fd6 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/ConfigAppPlansProvider.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/ConfigAppPlansProvider.cs @@ -30,8 +30,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans public ConfigAppPlansProvider(IEnumerable config) { - Guard.NotNull(config, nameof(config)); - foreach (var plan in config.OrderBy(x => x.MaxApiCalls).Select(x => x.Clone())) { plansList.Add(plan); @@ -70,6 +68,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans { Guard.NotNull(app, nameof(app)); + return GetPlanUpgrade(app.Plan?.PlanId); } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageGate.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageGate.cs index a65da64fd..2975b9c37 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageGate.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageGate.cs @@ -28,10 +28,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans public UsageGate(IAppPlansProvider appPlansProvider, IApiUsageTracker apiUsageTracker, IGrainFactory grainFactory) { - Guard.NotNull(apiUsageTracker, nameof(apiUsageTracker)); - Guard.NotNull(appPlansProvider, nameof(appPlansProvider)); - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.appPlansProvider = appPlansProvider; this.apiUsageTracker = apiUsageTracker; this.grainFactory = grainFactory; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs index 7c2029816..2e0e480a0 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs @@ -34,11 +34,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.Plans public UsageNotifierGrain(IGrainState state, INotificationSender notificationSender, IUserResolver userResolver, IClock clock) { - Guard.NotNull(state, nameof(state)); - Guard.NotNull(notificationSender, nameof(notificationSender)); - Guard.NotNull(userResolver, nameof(userResolver)); - Guard.NotNull(clock, nameof(clock)); - this.state = state; this.notificationSender = notificationSender; this.userResolver = userResolver; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs index d3a4863f7..23b355719 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/RolePermissionsProvider.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading.Tasks; -using Squidex.Infrastructure; using Squidex.Infrastructure.Security; using Squidex.Shared; @@ -28,8 +27,6 @@ namespace Squidex.Domain.Apps.Entities.Apps public RolePermissionsProvider(IAppProvider appProvider) { - Guard.NotNull(appProvider, nameof(appProvider)); - this.appProvider = appProvider; foreach (var field in typeof(Permissions).GetFields(BindingFlags.Public | BindingFlags.Static)) diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs index 5799be4cd..eaa637d13 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Templates/TemplateCommandMiddleware.cs @@ -23,8 +23,6 @@ namespace Squidex.Domain.Apps.Entities.Apps.Templates public TemplateCommandMiddleware(IEnumerable templates) { - Guard.NotNull(templates, nameof(templates)); - this.templates = templates.ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase); } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetChangedTriggerHandler.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetChangedTriggerHandler.cs index a247b8dfe..200c49e09 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetChangedTriggerHandler.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetChangedTriggerHandler.cs @@ -16,7 +16,6 @@ using Squidex.Domain.Apps.Core.Scripting; using Squidex.Domain.Apps.Entities.Assets.Repositories; using Squidex.Domain.Apps.Events; using Squidex.Domain.Apps.Events.Assets; -using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Reflection; @@ -37,10 +36,6 @@ namespace Squidex.Domain.Apps.Entities.Assets IAssetLoader assetLoader, IAssetRepository assetRepository) { - Guard.NotNull(scriptEngine, nameof(scriptEngine)); - Guard.NotNull(assetLoader, nameof(assetLoader)); - Guard.NotNull(assetRepository, nameof(assetRepository)); - this.scriptEngine = scriptEngine; this.assetLoader = assetLoader; this.assetRepository = assetRepository; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetOptions.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetOptions.cs index ad8608f92..89807945b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetOptions.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetOptions.cs @@ -11,6 +11,8 @@ namespace Squidex.Domain.Apps.Entities.Assets { public sealed class AssetOptions { + public bool FolderPerApp { get; set; } = false; + public int DefaultPageSize { get; set; } = 200; public int MaxResults { get; set; } = 200; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetPermanentDeleter.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetPermanentDeleter.cs index cb2b4b28f..2e9101c50 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetPermanentDeleter.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetPermanentDeleter.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Squidex.Assets; using Squidex.Domain.Apps.Events.Assets; -using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Reflection; @@ -31,8 +30,6 @@ namespace Squidex.Domain.Apps.Entities.Assets public AssetPermanentDeleter(IAssetFileStore assetFileStore, TypeNameRegistry typeNameRegistry) { - Guard.NotNull(assetFileStore, nameof(assetFileStore)); - this.assetFileStore = assetFileStore; deletedType = typeNameRegistry?.GetName(); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker.cs index 58c4d972e..5d5f190d2 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker.cs @@ -24,8 +24,6 @@ namespace Squidex.Domain.Apps.Entities.Assets public AssetUsageTracker(IUsageTracker usageTracker) { - Guard.NotNull(usageTracker, nameof(usageTracker)); - this.usageTracker = usageTracker; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsFluidExtension.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsFluidExtension.cs index 8d204e737..8240a23ca 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsFluidExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsFluidExtension.cs @@ -60,8 +60,6 @@ namespace Squidex.Domain.Apps.Entities.Assets public AssetsFluidExtension(IServiceProvider serviceProvider) { - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - this.serviceProvider = serviceProvider; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsJintExtension.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsJintExtension.cs index d79a7478e..9e331a1d1 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsJintExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsJintExtension.cs @@ -30,8 +30,6 @@ namespace Squidex.Domain.Apps.Entities.Assets public AssetsJintExtension(IServiceProvider serviceProvider) { - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - this.serviceProvider = serviceProvider; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsSearchSource.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsSearchSource.cs index 3b1dcceb2..234194999 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsSearchSource.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsSearchSource.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Squidex.Domain.Apps.Core; using Squidex.Domain.Apps.Entities.Apps; using Squidex.Domain.Apps.Entities.Search; -using Squidex.Infrastructure; using Squidex.Infrastructure.Queries; using Squidex.Shared; @@ -23,9 +22,6 @@ namespace Squidex.Domain.Apps.Entities.Assets public AssetsSearchSource(IAssetQueryService assetQuery, IUrlGenerator urlGenerator) { - Guard.NotNull(assetQuery, nameof(assetQuery)); - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.assetQuery = assetQuery; this.urlGenerator = urlGenerator; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/BackupAssets.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/BackupAssets.cs index cd5b8bd6a..bcd4df66c 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/BackupAssets.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/BackupAssets.cs @@ -33,10 +33,6 @@ namespace Squidex.Domain.Apps.Entities.Assets public BackupAssets(Rebuilder rebuilder, IAssetFileStore assetFileStore, ITagService tagService) { - Guard.NotNull(rebuilder, nameof(rebuilder)); - Guard.NotNull(assetFileStore, nameof(assetFileStore)); - Guard.NotNull(tagService, nameof(tagService)); - this.rebuilder = rebuilder; this.assetFileStore = assetFileStore; this.tagService = tagService; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/DefaultAssetFileStore.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/DefaultAssetFileStore.cs index 1aa7a0010..fbed03411 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/DefaultAssetFileStore.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/DefaultAssetFileStore.cs @@ -8,6 +8,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Options; using Squidex.Assets; using Squidex.Infrastructure; @@ -16,10 +17,14 @@ namespace Squidex.Domain.Apps.Entities.Assets public sealed class DefaultAssetFileStore : IAssetFileStore { private readonly IAssetStore assetStore; + private readonly AssetOptions options; - public DefaultAssetFileStore(IAssetStore assetStore) + public DefaultAssetFileStore(IAssetStore assetStore, + IOptions options) { this.assetStore = assetStore; + + this.options = options.Value; } public string? GeneratePublicUrl(DomainId appId, DomainId id, long fileVersion) @@ -105,9 +110,16 @@ namespace Squidex.Domain.Apps.Entities.Assets return $"{id}_{fileVersion}"; } - private static string GetFileName(DomainId appId, DomainId id, long fileVersion) + private string GetFileName(DomainId appId, DomainId id, long fileVersion) { - return $"{appId}_{id}_{fileVersion}"; + if (options.FolderPerApp) + { + return $"{appId}/{id}_{fileVersion}"; + } + else + { + return $"{appId}_{id}_{fileVersion}"; + } } } } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetCommandMiddleware.cs index 295488564..9f335bcd0 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetCommandMiddleware.cs @@ -34,12 +34,6 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject IEnumerable assetMetadataSources) : base(grainFactory) { - Guard.NotNull(assetEnricher, nameof(assetEnricher)); - Guard.NotNull(assetFileStore, nameof(assetFileStore)); - Guard.NotNull(assetMetadataSources, nameof(assetMetadataSources)); - Guard.NotNull(assetQuery, nameof(assetQuery)); - Guard.NotNull(contextProvider, nameof(contextProvider)); - this.assetEnricher = assetEnricher; this.assetFileStore = assetFileStore; this.assetMetadataSources = assetMetadataSources.OrderBy(x => x.Order).ToList(); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetDomainObject.cs index 1c6491944..8c8960d5f 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetDomainObject.cs @@ -36,10 +36,6 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject IContentRepository contentRepository) : base(factory, log) { - Guard.NotNull(assetTags, nameof(assetTags)); - Guard.NotNull(assetQuery, nameof(assetQuery)); - Guard.NotNull(contentRepository, nameof(contentRepository)); - this.assetTags = assetTags; this.assetQuery = assetQuery; this.contentRepository = contentRepository; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetFolderDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetFolderDomainObject.cs index 33f5a53d8..f43143ed1 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetFolderDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetFolderDomainObject.cs @@ -11,7 +11,6 @@ using Squidex.Domain.Apps.Entities.Assets.Commands; using Squidex.Domain.Apps.Entities.Assets.DomainObject.Guards; using Squidex.Domain.Apps.Events; using Squidex.Domain.Apps.Events.Assets; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Reflection; @@ -28,8 +27,6 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject IAssetQueryService assetQuery) : base(factory, log) { - Guard.NotNull(assetQuery, nameof(assetQuery)); - this.assetQuery = assetQuery; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetsBulkUpdateCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetsBulkUpdateCommandMiddleware.cs index 655d9213b..4a15ada0e 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetsBulkUpdateCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetsBulkUpdateCommandMiddleware.cs @@ -41,8 +41,6 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject public AssetsBulkUpdateCommandMiddleware(IContextProvider contextProvider) { - Guard.NotNull(contextProvider, nameof(contextProvider)); - this.contextProvider = contextProvider; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/ImageAssetMetadataSource.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/ImageAssetMetadataSource.cs index a42c24dbd..09268285b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/ImageAssetMetadataSource.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/ImageAssetMetadataSource.cs @@ -12,7 +12,6 @@ using System.Threading.Tasks; using Squidex.Assets; using Squidex.Domain.Apps.Core.Assets; using Squidex.Domain.Apps.Entities.Assets.Commands; -using Squidex.Infrastructure; namespace Squidex.Domain.Apps.Entities.Assets { @@ -22,8 +21,6 @@ namespace Squidex.Domain.Apps.Entities.Assets public ImageAssetMetadataSource(IAssetThumbnailGenerator assetThumbnailGenerator) { - Guard.NotNull(assetThumbnailGenerator, nameof(assetThumbnailGenerator)); - this.assetThumbnailGenerator = assetThumbnailGenerator; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetEnricher.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetEnricher.cs index e5d0c11d4..58a749372 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetEnricher.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetEnricher.cs @@ -26,10 +26,6 @@ namespace Squidex.Domain.Apps.Entities.Assets.Queries public AssetEnricher(ITagService tagService, IEnumerable assetMetadataSources, IRequestCache requestCache) { - Guard.NotNull(tagService, nameof(tagService)); - Guard.NotNull(assetMetadataSources, nameof(assetMetadataSources)); - Guard.NotNull(requestCache, nameof(requestCache)); - this.tagService = tagService; this.assetMetadataSources = assetMetadataSources; this.requestCache = requestCache; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetLoader.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetLoader.cs index b84854b0d..1fada21ec 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetLoader.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetLoader.cs @@ -19,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Assets.Queries public AssetLoader(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryParser.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryParser.cs index 90e3abde6..c5d09dbcb 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryParser.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryParser.cs @@ -36,11 +36,8 @@ namespace Squidex.Domain.Apps.Entities.Assets.Queries public AssetQueryParser(IJsonSerializer jsonSerializer, ITagService tagService, IOptions options) { - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - Guard.NotNull(options, nameof(options)); - Guard.NotNull(tagService, nameof(tagService)); - this.jsonSerializer = jsonSerializer; + this.tagService = tagService; this.options = options.Value; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryService.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryService.cs index e6e435bd9..f4ed509e7 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/Queries/AssetQueryService.cs @@ -34,13 +34,6 @@ namespace Squidex.Domain.Apps.Entities.Assets.Queries IOptions options, AssetQueryParser queryParser) { - Guard.NotNull(assetEnricher, nameof(assetEnricher)); - Guard.NotNull(assetRepository, nameof(assetRepository)); - Guard.NotNull(assetLoader, nameof(assetLoader)); - Guard.NotNull(assetFolderRepository, nameof(assetFolderRepository)); - Guard.NotNull(options, nameof(options)); - Guard.NotNull(queryParser, nameof(queryParser)); - this.assetEnricher = assetEnricher; this.assetRepository = assetRepository; this.assetLoader = assetLoader; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/RebuildFiles.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/RebuildFiles.cs index 26696979f..263a6fb82 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/RebuildFiles.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/RebuildFiles.cs @@ -28,10 +28,6 @@ namespace Squidex.Domain.Apps.Entities.Assets IEventStore eventStore, IEventDataFormatter eventDataFormatter) { - Guard.NotNull(assetFileStore, nameof(assetFileStore)); - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); - this.assetFileStore = assetFileStore; this.eventStore = eventStore; this.eventDataFormatter = eventDataFormatter; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/RecursiveDeleter.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/RecursiveDeleter.cs index 24a7b1eb2..d865d4c0a 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/RecursiveDeleter.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/RecursiveDeleter.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Squidex.Domain.Apps.Entities.Assets.Commands; using Squidex.Domain.Apps.Entities.Assets.Repositories; using Squidex.Domain.Apps.Events.Assets; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Reflection; @@ -43,11 +42,6 @@ namespace Squidex.Domain.Apps.Entities.Assets TypeNameRegistry typeNameRegistry, ISemanticLog log) { - Guard.NotNull(commandBus, nameof(commandBus)); - Guard.NotNull(assetRepository, nameof(assetRepository)); - Guard.NotNull(assetFolderRepository, nameof(assetFolderRepository)); - Guard.NotNull(log, nameof(log)); - this.commandBus = commandBus; this.assetRepository = assetRepository; this.assetFolderRepository = assetFolderRepository; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupGrain.cs index 96cfa06ab..cc9b5204e 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupGrain.cs @@ -54,16 +54,6 @@ namespace Squidex.Domain.Apps.Entities.Backup IUserResolver userResolver, ISemanticLog log) { - Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation)); - Guard.NotNull(backupArchiveStore, nameof(backupArchiveStore)); - Guard.NotNull(clock, nameof(clock)); - Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - Guard.NotNull(state, nameof(state)); - Guard.NotNull(userResolver, nameof(userResolver)); - Guard.NotNull(log, nameof(log)); - this.backupArchiveLocation = backupArchiveLocation; this.backupArchiveStore = backupArchiveStore; this.clock = clock; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupService.cs b/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupService.cs index 446df5487..8c3ac5f5b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupService.cs @@ -20,8 +20,6 @@ namespace Squidex.Domain.Apps.Entities.Backup public BackupService(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Backup/DefaultBackupArchiveStore.cs b/backend/src/Squidex.Domain.Apps.Entities/Backup/DefaultBackupArchiveStore.cs index f6f111971..0bed53d05 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Backup/DefaultBackupArchiveStore.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Backup/DefaultBackupArchiveStore.cs @@ -19,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Backup public DefaultBackupArchiveStore(IAssetStore assetStore) { - Guard.NotNull(assetStore, nameof(assetStore)); - this.assetStore = assetStore; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs index 747a6fb7d..7146a16f9 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Backup/RestoreGrain.cs @@ -61,17 +61,6 @@ namespace Squidex.Domain.Apps.Entities.Backup IUserResolver userResolver, ISemanticLog log) { - Guard.NotNull(backupArchiveLocation, nameof(backupArchiveLocation)); - Guard.NotNull(clock, nameof(clock)); - Guard.NotNull(commandBus, nameof(commandBus)); - Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - Guard.NotNull(state, nameof(state)); - Guard.NotNull(streamNameResolver, nameof(streamNameResolver)); - Guard.NotNull(userResolver, nameof(userResolver)); - Guard.NotNull(log, nameof(log)); - this.backupArchiveLocation = backupArchiveLocation; this.clock = clock; this.commandBus = commandBus; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Backup/TempFolderBackupArchiveLocation.cs b/backend/src/Squidex.Domain.Apps.Entities/Backup/TempFolderBackupArchiveLocation.cs index 10b55341c..0dbe14c36 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Backup/TempFolderBackupArchiveLocation.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Backup/TempFolderBackupArchiveLocation.cs @@ -22,8 +22,6 @@ namespace Squidex.Domain.Apps.Entities.Backup public TempFolderBackupArchiveLocation(IJsonSerializer jsonSerializer) { - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - this.jsonSerializer = jsonSerializer; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Comments/CommentTriggerHandler.cs b/backend/src/Squidex.Domain.Apps.Entities/Comments/CommentTriggerHandler.cs index 6e7269c4a..3d0d81f25 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Comments/CommentTriggerHandler.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Comments/CommentTriggerHandler.cs @@ -15,7 +15,6 @@ using Squidex.Domain.Apps.Core.Rules.Triggers; using Squidex.Domain.Apps.Core.Scripting; using Squidex.Domain.Apps.Events; using Squidex.Domain.Apps.Events.Comments; -using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Reflection; using Squidex.Shared.Users; @@ -31,9 +30,6 @@ namespace Squidex.Domain.Apps.Entities.Comments public CommentTriggerHandler(IScriptEngine scriptEngine, IUserResolver userResolver) { - Guard.NotNull(scriptEngine, nameof(scriptEngine)); - Guard.NotNull(userResolver, nameof(userResolver)); - this.scriptEngine = scriptEngine; this.userResolver = userResolver; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsCommandMiddleware.cs index 77998a5a8..019e161cc 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsCommandMiddleware.cs @@ -12,7 +12,6 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using Orleans; using Squidex.Domain.Apps.Entities.Comments.Commands; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Orleans; using Squidex.Shared.Users; @@ -27,9 +26,6 @@ namespace Squidex.Domain.Apps.Entities.Comments.DomainObject public CommentsCommandMiddleware(IGrainFactory grainFactory, IUserResolver userResolver) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - Guard.NotNull(userResolver, nameof(userResolver)); - this.grainFactory = grainFactory; this.userResolver = userResolver; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsGrain.cs index c98a80613..8931b1812 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsGrain.cs @@ -36,9 +36,6 @@ namespace Squidex.Domain.Apps.Entities.Comments.DomainObject public CommentsGrain(IEventStore eventStore, IEventDataFormatter eventDataFormatter) { - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); - this.eventStore = eventStore; this.eventDataFormatter = eventDataFormatter; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs index e79ad9a0e..705875606 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs @@ -56,9 +56,6 @@ namespace Squidex.Domain.Apps.Entities.Contents public BackupContents(Rebuilder rebuilder, IUrlGenerator urlGenerator) { - Guard.NotNull(rebuilder, nameof(rebuilder)); - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.rebuilder = rebuilder; this.urlGenerator = urlGenerator; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentChangedTriggerHandler.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentChangedTriggerHandler.cs index 8094f7346..1e9f311e3 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentChangedTriggerHandler.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentChangedTriggerHandler.cs @@ -45,10 +45,6 @@ namespace Squidex.Domain.Apps.Entities.Contents IContentLoader contentLoader, IContentRepository contentRepository) { - Guard.NotNull(scriptEngine, nameof(scriptEngine)); - Guard.NotNull(contentLoader, nameof(contentLoader)); - Guard.NotNull(contentRepository, nameof(contentRepository)); - this.scriptEngine = scriptEngine; this.contentLoader = contentLoader; this.contentRepository = contentRepository; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentSchedulerGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentSchedulerGrain.cs index ef6f42ef0..bb20a5a69 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentSchedulerGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentSchedulerGrain.cs @@ -33,11 +33,6 @@ namespace Squidex.Domain.Apps.Entities.Contents IClock clock, ISemanticLog log) { - Guard.NotNull(contentRepository, nameof(contentRepository)); - Guard.NotNull(commandBus, nameof(commandBus)); - Guard.NotNull(clock, nameof(clock)); - Guard.NotNull(log, nameof(log)); - this.clock = clock; this.commandBus = commandBus; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentsSearchSource.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentsSearchSource.cs index 980837024..764a63449 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentsSearchSource.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentsSearchSource.cs @@ -35,11 +35,6 @@ namespace Squidex.Domain.Apps.Entities.Contents ITextIndex contentTextIndexer, IUrlGenerator urlGenerator) { - Guard.NotNull(appProvider, nameof(appProvider)); - Guard.NotNull(contentQuery, nameof(contentQuery)); - Guard.NotNull(contentTextIndexer, nameof(contentTextIndexer)); - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.appProvider = appProvider; this.contentQuery = contentQuery; this.contentTextIndexer = contentTextIndexer; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Counter/CounterGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Counter/CounterGrain.cs index a410848b6..71ba48291 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Counter/CounterGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Counter/CounterGrain.cs @@ -7,7 +7,6 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Squidex.Infrastructure; using Squidex.Infrastructure.Orleans; using Squidex.Infrastructure.States; @@ -25,8 +24,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Counter public CounterGrain(IGrainState state) { - Guard.NotNull(state, nameof(state)); - this.state = state; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Counter/CounterJintExtension.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Counter/CounterJintExtension.cs index 322ea9d8b..203bd7a5e 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Counter/CounterJintExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Counter/CounterJintExtension.cs @@ -19,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Counter public CounterJintExtension(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DefaultWorkflowsValidator.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DefaultWorkflowsValidator.cs index 2286c4439..a2bc0031a 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DefaultWorkflowsValidator.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DefaultWorkflowsValidator.cs @@ -20,8 +20,6 @@ namespace Squidex.Domain.Apps.Entities.Contents public DefaultWorkflowsValidator(IAppProvider appProvider) { - Guard.NotNull(appProvider, nameof(appProvider)); - this.appProvider = appProvider; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentCommandMiddleware.cs index bcb6c14fe..7458c39e8 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentCommandMiddleware.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Orleans; using Squidex.Domain.Apps.Entities.Contents.Commands; using Squidex.Domain.Apps.Entities.Contents.Queries; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; namespace Squidex.Domain.Apps.Entities.Contents.DomainObject @@ -22,9 +21,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.DomainObject public ContentCommandMiddleware(IGrainFactory grainFactory, IContentEnricher contentEnricher, IContextProvider contextProvider) : base(grainFactory) { - Guard.NotNull(contentEnricher, nameof(contentEnricher)); - Guard.NotNull(contextProvider, nameof(contextProvider)); - this.contentEnricher = contentEnricher; this.contextProvider = contextProvider; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs index e4fa44528..d80aff0e9 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentDomainObject.cs @@ -33,8 +33,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.DomainObject IServiceProvider serviceProvider) : base(persistence, log) { - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - this.serviceProvider = serviceProvider; Capacity = int.MaxValue; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentsBulkUpdateCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentsBulkUpdateCommandMiddleware.cs index 9b2575f26..8ac0a09d2 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentsBulkUpdateCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DomainObject/ContentsBulkUpdateCommandMiddleware.cs @@ -47,9 +47,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.DomainObject public ContentsBulkUpdateCommandMiddleware(IContentQueryService contentQuery, IContextProvider contextProvider) { - Guard.NotNull(contentQuery, nameof(contentQuery)); - Guard.NotNull(contextProvider, nameof(contextProvider)); - this.contentQuery = contentQuery; this.contextProvider = contextProvider; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/DynamicContentWorkflow.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/DynamicContentWorkflow.cs index 88f8c8739..3ccc8dcaa 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/DynamicContentWorkflow.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/DynamicContentWorkflow.cs @@ -23,9 +23,6 @@ namespace Squidex.Domain.Apps.Entities.Contents public DynamicContentWorkflow(IScriptEngine scriptEngine, IAppProvider appProvider) { - Guard.NotNull(scriptEngine, nameof(scriptEngine)); - Guard.NotNull(appProvider, nameof(appProvider)); - this.scriptEngine = scriptEngine; this.appProvider = appProvider; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/CachingGraphQLService.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/CachingGraphQLService.cs index 28242adad..463330f73 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/CachingGraphQLService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/CachingGraphQLService.cs @@ -40,11 +40,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL public CachingGraphQLService(IBackgroundCache cache, ISchemasHash schemasHash, IServiceProvider serviceProvider, IOptions options) { - Guard.NotNull(cache, nameof(cache)); - Guard.NotNull(schemasHash, nameof(schemasHash)); - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - Guard.NotNull(options, nameof(options)); - this.cache = cache; this.schemasHash = schemasHash; this.serviceProvider = serviceProvider; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/DefaultDocumentWriter.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/DefaultDocumentWriter.cs index 90a5d5130..9b15fcd32 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/DefaultDocumentWriter.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/DefaultDocumentWriter.cs @@ -10,7 +10,6 @@ using System.Threading; using System.Threading.Tasks; using GraphQL; using Microsoft.AspNetCore.WebUtilities; -using Squidex.Infrastructure; using Squidex.Infrastructure.Json; namespace Squidex.Domain.Apps.Entities.Contents.GraphQL @@ -21,8 +20,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL public DefaultDocumentWriter(IJsonSerializer jsonSerializer) { - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - this.jsonSerializer = jsonSerializer; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentEnricher.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentEnricher.cs index d24bf1894..67e605fed 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentEnricher.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentEnricher.cs @@ -29,9 +29,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries public ContentEnricher(IEnumerable steps, Lazy contentQuery) { - Guard.NotNull(steps, nameof(steps)); - Guard.NotNull(contentQuery, nameof(contentQuery)); - this.steps = steps; this.contentQuery = contentQuery; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentLoader.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentLoader.cs index 0bdbb3f8a..def19558c 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentLoader.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentLoader.cs @@ -19,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries public ContentLoader(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs index 4befe088e..c56a577f3 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs @@ -45,11 +45,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries public ContentQueryParser(IMemoryCache cache, IJsonSerializer jsonSerializer, ITextIndex textIndex, IOptions options) { - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - Guard.NotNull(textIndex, nameof(textIndex)); - Guard.NotNull(cache, nameof(cache)); - Guard.NotNull(options, nameof(options)); - this.jsonSerializer = jsonSerializer; this.textIndex = textIndex; this.cache = cache; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryService.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryService.cs index f907f516c..c430b46c5 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryService.cs @@ -40,13 +40,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries IOptions options, ContentQueryParser queryParser) { - Guard.NotNull(appProvider, nameof(appProvider)); - Guard.NotNull(contentEnricher, nameof(contentEnricher)); - Guard.NotNull(contentRepository, nameof(contentRepository)); - Guard.NotNull(contentLoader, nameof(contentLoader)); - Guard.NotNull(options, nameof(options)); - Guard.NotNull(queryParser, nameof(queryParser)); - this.appProvider = appProvider; this.contentEnricher = contentEnricher; this.contentRepository = contentRepository; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs index 655811602..b889aac8d 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs @@ -34,11 +34,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries.Steps public ConvertData(IUrlGenerator urlGenerator, IJsonSerializer jsonSerializer, IAssetRepository assetRepository, IContentRepository contentRepository) { - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - Guard.NotNull(assetRepository, nameof(assetRepository)); - Guard.NotNull(contentRepository, nameof(contentRepository)); - this.urlGenerator = urlGenerator; this.assetRepository = assetRepository; this.contentRepository = contentRepository; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/EnrichForCaching.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/EnrichForCaching.cs index 949806aef..1dc602d6d 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/EnrichForCaching.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/EnrichForCaching.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; -using Squidex.Infrastructure; using Squidex.Infrastructure.Caching; namespace Squidex.Domain.Apps.Entities.Contents.Queries.Steps @@ -20,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries.Steps public EnrichForCaching(IRequestCache requestCache) { - Guard.NotNull(requestCache, nameof(requestCache)); - this.requestCache = requestCache; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/EnrichWithWorkflows.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/EnrichWithWorkflows.cs index 4dda4332b..47b23dbf5 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/EnrichWithWorkflows.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/EnrichWithWorkflows.cs @@ -22,8 +22,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries.Steps public EnrichWithWorkflows(IContentWorkflow contentWorkflow) { - Guard.NotNull(contentWorkflow, nameof(contentWorkflow)); - this.contentWorkflow = contentWorkflow; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ResolveAssets.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ResolveAssets.cs index 3c2a9c2ad..7b9bd142f 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ResolveAssets.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ResolveAssets.cs @@ -32,10 +32,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries.Steps public ResolveAssets(IUrlGenerator urlGenerator, IAssetQueryService assetQuery, IRequestCache requestCache) { - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - Guard.NotNull(assetQuery, nameof(assetQuery)); - Guard.NotNull(requestCache, nameof(requestCache)); - this.urlGenerator = urlGenerator; this.assetQuery = assetQuery; this.requestCache = requestCache; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ResolveReferences.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ResolveReferences.cs index fcaa8afd2..cbae70937 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ResolveReferences.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ResolveReferences.cs @@ -34,9 +34,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries.Steps public ResolveReferences(Lazy contentQuery, IRequestCache requestCache) { - Guard.NotNull(contentQuery, nameof(contentQuery)); - Guard.NotNull(requestCache, nameof(requestCache)); - this.contentQuery = contentQuery; this.requestCache = requestCache; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ScriptContent.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ScriptContent.cs index f0cf237f1..b17db069b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ScriptContent.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ScriptContent.cs @@ -10,7 +10,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Squidex.Domain.Apps.Core.Scripting; -using Squidex.Infrastructure; namespace Squidex.Domain.Apps.Entities.Contents.Queries.Steps { @@ -20,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries.Steps public ScriptContent(IScriptEngine scriptEngine) { - Guard.NotNull(scriptEngine, nameof(scriptEngine)); - this.scriptEngine = scriptEngine; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs index 6b6c67abf..95df274e2 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs @@ -60,8 +60,6 @@ namespace Squidex.Domain.Apps.Entities.Contents public ReferencesFluidExtension(IServiceProvider serviceProvider) { - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - this.serviceProvider = serviceProvider; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesJintExtension.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesJintExtension.cs index 5079373bf..5562a147a 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesJintExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesJintExtension.cs @@ -27,8 +27,6 @@ namespace Squidex.Domain.Apps.Entities.Contents public ReferencesJintExtension(IServiceProvider serviceProvider) { - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - this.serviceProvider = serviceProvider; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs index ee057d813..05a9ac38b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/Elastic/ElasticSearchTextIndex.cs @@ -27,9 +27,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Text.Elastic public ElasticSearchTextIndex(string configurationString, string indexName, bool waitForTesting = false) { - Guard.NotNull(configurationString, nameof(configurationString)); - Guard.NotNull(indexName, nameof(indexName)); - var config = new ConnectionConfiguration(new Uri(configurationString)); client = new ElasticLowLevelClient(config); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs index f5c358dbe..38a5822a7 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs @@ -335,10 +335,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Text ITextIndex textIndex, ITextIndexerState textIndexerState) { - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - Guard.NotNull(textIndex, nameof(textIndex)); - Guard.NotNull(textIndexerState, nameof(textIndexerState)); - this.jsonSerializer = jsonSerializer; this.textIndex = textIndex; this.textIndexerState = textIndexerState; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Validation/DependencyValidatorsFactory.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Validation/DependencyValidatorsFactory.cs index bedba96db..2a88bafc8 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Validation/DependencyValidatorsFactory.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Validation/DependencyValidatorsFactory.cs @@ -11,7 +11,6 @@ using Squidex.Domain.Apps.Core.ValidateContent; using Squidex.Domain.Apps.Core.ValidateContent.Validators; using Squidex.Domain.Apps.Entities.Assets.Repositories; using Squidex.Domain.Apps.Entities.Contents.Repositories; -using Squidex.Infrastructure; namespace Squidex.Domain.Apps.Entities.Contents.Validation { @@ -22,9 +21,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Validation public DependencyValidatorsFactory(IAssetRepository assetRepository, IContentRepository contentRepository) { - Guard.NotNull(assetRepository, nameof(assetRepository)); - Guard.NotNull(contentRepository, nameof(contentRepository)); - this.assetRepository = assetRepository; this.contentRepository = contentRepository; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs b/backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs index b2b3cc4aa..a746ef0a9 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs @@ -39,10 +39,6 @@ namespace Squidex.Domain.Apps.Entities.History public HistoryService(IHistoryEventRepository repository, IEnumerable creators, NotifoService notifo) { - Guard.NotNull(repository, nameof(repository)); - Guard.NotNull(creators, nameof(creators)); - Guard.NotNull(notifo, nameof(notifo)); - this.creators = creators.ToList(); foreach (var creator in this.creators) diff --git a/backend/src/Squidex.Domain.Apps.Entities/History/NotifoService.cs b/backend/src/Squidex.Domain.Apps.Entities/History/NotifoService.cs index 0ce37bee2..9c2ba4313 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/History/NotifoService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/History/NotifoService.cs @@ -42,17 +42,12 @@ namespace Squidex.Domain.Apps.Entities.History ISemanticLog log, IClock clock) { - Guard.NotNull(options, nameof(options)); - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - Guard.NotNull(userResolver, nameof(userResolver)); - Guard.NotNull(log, nameof(log)); - Guard.NotNull(clock, nameof(clock)); - this.options = options.Value; this.urlGenerator = urlGenerator; this.userResolver = userResolver; this.clock = clock; + this.log = log; if (options.Value.IsConfigured()) @@ -72,10 +67,10 @@ namespace Squidex.Domain.Apps.Entities.History public async Task OnUserCreatedAsync(IUser user) { - if (!string.IsNullOrWhiteSpace(user.Email)) - { - await UpsertUserAsync(user); - } + if (!string.IsNullOrWhiteSpace(user.Email)) + { + await UpsertUserAsync(user); + } } public async Task OnUserUpdatedAsync(IUser user, IUser previous) diff --git a/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs b/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs index 8782554a2..626e53ea0 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs @@ -50,14 +50,10 @@ namespace Squidex.Domain.Apps.Entities.Notifications IUrlGenerator urlGenerator, ISemanticLog log) { - Guard.NotNull(texts, nameof(texts)); - Guard.NotNull(emailSender, nameof(emailSender)); - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - Guard.NotNull(log, nameof(log)); - this.texts = texts.Value; this.emailSender = emailSender; this.urlGenerator = urlGenerator; + this.log = log; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/BackupRules.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/BackupRules.cs index bff44e872..da9d4a37d 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/BackupRules.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/BackupRules.cs @@ -24,8 +24,6 @@ namespace Squidex.Domain.Apps.Entities.Rules public BackupRules(IRulesIndex indexForRules) { - Guard.NotNull(indexForRules, nameof(indexForRules)); - this.indexForRules = indexForRules; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/DomainObject/RuleDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/DomainObject/RuleDomainObject.cs index a081c499e..bf5555e87 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/DomainObject/RuleDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/DomainObject/RuleDomainObject.cs @@ -11,7 +11,6 @@ using Squidex.Domain.Apps.Entities.Rules.Commands; using Squidex.Domain.Apps.Entities.Rules.DomainObject.Guards; using Squidex.Domain.Apps.Events; using Squidex.Domain.Apps.Events.Rules; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Reflection; @@ -29,9 +28,6 @@ namespace Squidex.Domain.Apps.Entities.Rules.DomainObject IAppProvider appProvider, IRuleEnqueuer ruleEnqueuer) : base(factory, log) { - Guard.NotNull(appProvider, nameof(appProvider)); - Guard.NotNull(ruleEnqueuer, nameof(ruleEnqueuer)); - this.appProvider = appProvider; this.ruleEnqueuer = ruleEnqueuer; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Indexes/RulesIndex.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Indexes/RulesIndex.cs index 1d07650c9..737322d39 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/Indexes/RulesIndex.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Indexes/RulesIndex.cs @@ -23,8 +23,6 @@ namespace Squidex.Domain.Apps.Entities.Rules.Indexes public RulesIndex(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Queries/RuleEnricher.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Queries/RuleEnricher.cs index f7d5d1b36..b4b1b2598 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/Queries/RuleEnricher.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Queries/RuleEnricher.cs @@ -23,9 +23,6 @@ namespace Squidex.Domain.Apps.Entities.Rules.Queries public RuleEnricher(IRuleEventRepository ruleEventRepository, IRequestCache requestCache) { - Guard.NotNull(ruleEventRepository, nameof(ruleEventRepository)); - Guard.NotNull(requestCache, nameof(requestCache)); - this.ruleEventRepository = ruleEventRepository; this.requestCache = requestCache; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Queries/RuleQueryService.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Queries/RuleQueryService.cs index c73d6bfda..91d63dfd9 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/Queries/RuleQueryService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Queries/RuleQueryService.cs @@ -8,7 +8,6 @@ using System.Collections.Generic; using System.Threading.Tasks; using Squidex.Domain.Apps.Entities.Rules.Indexes; -using Squidex.Infrastructure; namespace Squidex.Domain.Apps.Entities.Rules.Queries { @@ -20,9 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Rules.Queries public RuleQueryService(IRulesIndex rulesIndex, IRuleEnricher ruleEnricher) { - Guard.NotNull(rulesIndex, nameof(rulesIndex)); - Guard.NotNull(ruleEnricher, nameof(ruleEnricher)); - this.rulesIndex = rulesIndex; this.ruleEnricher = ruleEnricher; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleCommandMiddleware.cs index d125dd863..624363c14 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleCommandMiddleware.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Orleans; using Squidex.Domain.Apps.Entities.Rules.Commands; using Squidex.Domain.Apps.Entities.Rules.DomainObject; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; namespace Squidex.Domain.Apps.Entities.Rules @@ -22,9 +21,6 @@ namespace Squidex.Domain.Apps.Entities.Rules public RuleCommandMiddleware(IGrainFactory grainFactory, IRuleEnricher ruleEnricher, IContextProvider contextProvider) : base(grainFactory) { - Guard.NotNull(ruleEnricher, nameof(ruleEnricher)); - Guard.NotNull(contextProvider, nameof(contextProvider)); - this.ruleEnricher = ruleEnricher; this.contextProvider = contextProvider; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleDequeuerGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleDequeuerGrain.cs index ddfcdc24f..eba840650 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleDequeuerGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleDequeuerGrain.cs @@ -35,11 +35,6 @@ namespace Squidex.Domain.Apps.Entities.Rules IRuleEventRepository ruleEventRepository, ISemanticLog log, IClock clock) { - Guard.NotNull(ruleEventRepository, nameof(ruleEventRepository)); - Guard.NotNull(ruleService, nameof(ruleService)); - Guard.NotNull(clock, nameof(clock)); - Guard.NotNull(log, nameof(log)); - this.ruleEventRepository = ruleEventRepository; this.ruleService = ruleService; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleEnqueuer.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleEnqueuer.cs index 76d8f6610..48669a9e8 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleEnqueuer.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/RuleEnqueuer.cs @@ -37,12 +37,6 @@ namespace Squidex.Domain.Apps.Entities.Rules IRuleEventRepository ruleEventRepository, IRuleService ruleService) { - Guard.NotNull(appProvider, nameof(appProvider)); - Guard.NotNull(cache, nameof(cache)); - Guard.NotNull(localCache, nameof(localCache)); - Guard.NotNull(ruleEventRepository, nameof(ruleEventRepository)); - Guard.NotNull(ruleService, nameof(ruleService)); - this.appProvider = appProvider; this.cache = cache; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/DefaultRuleRunnerService.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/DefaultRuleRunnerService.cs index 84ae5d952..050415da9 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/DefaultRuleRunnerService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/DefaultRuleRunnerService.cs @@ -31,11 +31,6 @@ namespace Squidex.Domain.Apps.Entities.Rules.Runner IEventDataFormatter eventDataFormatter, IRuleService ruleService) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(ruleService, nameof(ruleService)); - this.grainFactory = grainFactory; this.eventDataFormatter = eventDataFormatter; this.eventStore = eventStore; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerGrain.cs index 507c854bc..5d3597fad 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerGrain.cs @@ -60,15 +60,6 @@ namespace Squidex.Domain.Apps.Entities.Rules.Runner IRuleService ruleService, ISemanticLog log) { - Guard.NotNull(state, nameof(state)); - Guard.NotNull(appProvider, nameof(appProvider)); - Guard.NotNull(localCache, nameof(localCache)); - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); - Guard.NotNull(ruleEventRepository, nameof(ruleEventRepository)); - Guard.NotNull(ruleService, nameof(ruleService)); - Guard.NotNull(log, nameof(log)); - this.state = state; this.appProvider = appProvider; this.localCache = localCache; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/UsageTracking/UsageTrackerCommandMiddleware.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/UsageTracking/UsageTrackerCommandMiddleware.cs index 24d75a853..8196a5c1e 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/UsageTracking/UsageTrackerCommandMiddleware.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/UsageTracking/UsageTrackerCommandMiddleware.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Orleans; using Squidex.Domain.Apps.Core.Rules.Triggers; using Squidex.Domain.Apps.Entities.Rules.Commands; -using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Orleans; @@ -21,8 +20,6 @@ namespace Squidex.Domain.Apps.Entities.Rules.UsageTracking public UsageTrackerCommandMiddleware(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/UsageTracking/UsageTrackerGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/UsageTracking/UsageTrackerGrain.cs index 19de1d9e9..4081418a3 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/UsageTracking/UsageTrackerGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/UsageTracking/UsageTrackerGrain.cs @@ -66,9 +66,6 @@ namespace Squidex.Domain.Apps.Entities.Rules.UsageTracking public UsageTrackerGrain(IGrainState state, IApiUsageTracker usageTracker) { - Guard.NotNull(state, nameof(state)); - Guard.NotNull(usageTracker, nameof(usageTracker)); - this.state = state; this.usageTracker = usageTracker; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Schemas/BackupSchemas.cs b/backend/src/Squidex.Domain.Apps.Entities/Schemas/BackupSchemas.cs index 572246578..4f69a8d29 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Schemas/BackupSchemas.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Schemas/BackupSchemas.cs @@ -24,8 +24,6 @@ namespace Squidex.Domain.Apps.Entities.Schemas public BackupSchemas(ISchemasIndex indexSchemas) { - Guard.NotNull(indexSchemas, nameof(indexSchemas)); - this.indexSchemas = indexSchemas; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs b/backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs index f6c7b486b..f7d86dedb 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs @@ -30,9 +30,6 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes public SchemasIndex(IGrainFactory grainFactory, IReplicatedCache grainCache) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - Guard.NotNull(grainCache, nameof(grainCache)); - this.grainFactory = grainFactory; this.grainCache = grainCache; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemaChangedTriggerHandler.cs b/backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemaChangedTriggerHandler.cs index 9c447addd..64d177d2a 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemaChangedTriggerHandler.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemaChangedTriggerHandler.cs @@ -16,7 +16,6 @@ using Squidex.Domain.Apps.Core.Rules.Triggers; using Squidex.Domain.Apps.Core.Scripting; using Squidex.Domain.Apps.Events; using Squidex.Domain.Apps.Events.Schemas; -using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Reflection; @@ -30,8 +29,6 @@ namespace Squidex.Domain.Apps.Entities.Schemas public SchemaChangedTriggerHandler(IScriptEngine scriptEngine) { - Guard.NotNull(scriptEngine, nameof(scriptEngine)); - this.scriptEngine = scriptEngine; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemasSearchSource.cs b/backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemasSearchSource.cs index 1540fe36e..855e4d8af 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemasSearchSource.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Schemas/SchemasSearchSource.cs @@ -24,9 +24,6 @@ namespace Squidex.Domain.Apps.Entities.Schemas public SchemasSearchSource(IAppProvider appProvider, IUrlGenerator urlGenerator) { - Guard.NotNull(appProvider, nameof(appProvider)); - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.appProvider = appProvider; this.urlGenerator = urlGenerator; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Search/SearchManager.cs b/backend/src/Squidex.Domain.Apps.Entities/Search/SearchManager.cs index c8fbe8fcd..1995bd2f0 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Search/SearchManager.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Search/SearchManager.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; -using Squidex.Infrastructure; using Squidex.Log; namespace Squidex.Domain.Apps.Entities.Search @@ -23,9 +22,6 @@ namespace Squidex.Domain.Apps.Entities.Search public SearchManager(IEnumerable searchSources, ISemanticLog log) { - Guard.NotNull(searchSources, nameof(searchSources)); - Guard.NotNull(log, nameof(log)); - this.searchSources = searchSources; this.log = log; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs b/backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs index 9964a2a55..53629c5b4 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Tags/GrainTagService.cs @@ -19,8 +19,6 @@ namespace Squidex.Domain.Apps.Entities.Tags public GrainTagService(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Tags/TagGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Tags/TagGrain.cs index f6f2d8860..41249e4c5 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Tags/TagGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Tags/TagGrain.cs @@ -28,8 +28,6 @@ namespace Squidex.Domain.Apps.Entities.Tags public TagGrain(IGrainState state) { - Guard.NotNull(state, nameof(state)); - this.state = state; } diff --git a/backend/src/Squidex.Domain.Users/DefaultKeyStore.cs b/backend/src/Squidex.Domain.Users/DefaultKeyStore.cs index 5a7e305fe..eb4164005 100644 --- a/backend/src/Squidex.Domain.Users/DefaultKeyStore.cs +++ b/backend/src/Squidex.Domain.Users/DefaultKeyStore.cs @@ -12,7 +12,6 @@ using IdentityModel; using Microsoft.Extensions.Options; using Microsoft.IdentityModel.Tokens; using OpenIddict.Server; -using Squidex.Infrastructure; using Squidex.Infrastructure.States; namespace Squidex.Domain.Users @@ -31,8 +30,6 @@ namespace Squidex.Domain.Users public DefaultKeyStore(ISnapshotStore store) { - Guard.NotNull(store, nameof(store)); - this.store = store; } diff --git a/backend/src/Squidex.Domain.Users/DefaultUserPictureStore.cs b/backend/src/Squidex.Domain.Users/DefaultUserPictureStore.cs index da8edb806..51d7648ea 100644 --- a/backend/src/Squidex.Domain.Users/DefaultUserPictureStore.cs +++ b/backend/src/Squidex.Domain.Users/DefaultUserPictureStore.cs @@ -9,7 +9,6 @@ using System.IO; using System.Threading; using System.Threading.Tasks; using Squidex.Assets; -using Squidex.Infrastructure; namespace Squidex.Domain.Users { @@ -19,8 +18,6 @@ namespace Squidex.Domain.Users public DefaultUserPictureStore(IAssetStore assetStore) { - Guard.NotNull(assetStore, nameof(assetStore)); - this.assetStore = assetStore; } diff --git a/backend/src/Squidex.Domain.Users/DefaultUserResolver.cs b/backend/src/Squidex.Domain.Users/DefaultUserResolver.cs index 390257e9d..2b571ddcb 100644 --- a/backend/src/Squidex.Domain.Users/DefaultUserResolver.cs +++ b/backend/src/Squidex.Domain.Users/DefaultUserResolver.cs @@ -24,8 +24,6 @@ namespace Squidex.Domain.Users public DefaultUserResolver(IServiceProvider serviceProvider) { - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - this.serviceProvider = serviceProvider; } diff --git a/backend/src/Squidex.Domain.Users/DefaultUserService.cs b/backend/src/Squidex.Domain.Users/DefaultUserService.cs index 75d69d259..2d57d4c1f 100644 --- a/backend/src/Squidex.Domain.Users/DefaultUserService.cs +++ b/backend/src/Squidex.Domain.Users/DefaultUserService.cs @@ -30,11 +30,6 @@ namespace Squidex.Domain.Users public DefaultUserService(UserManager userManager, IUserFactory userFactory, IEnumerable userEvents, ISemanticLog log) { - Guard.NotNull(userManager, nameof(userManager)); - Guard.NotNull(userFactory, nameof(userFactory)); - Guard.NotNull(userEvents, nameof(userEvents)); - Guard.NotNull(log, nameof(log)); - this.userManager = userManager; this.userFactory = userFactory; this.userEvents = userEvents; diff --git a/backend/src/Squidex.Domain.Users/DefaultXmlRepository.cs b/backend/src/Squidex.Domain.Users/DefaultXmlRepository.cs index dbb0ccaff..cdca50443 100644 --- a/backend/src/Squidex.Domain.Users/DefaultXmlRepository.cs +++ b/backend/src/Squidex.Domain.Users/DefaultXmlRepository.cs @@ -40,8 +40,6 @@ namespace Squidex.Domain.Users public DefaultXmlRepository(ISnapshotStore store) { - Guard.NotNull(store, nameof(store)); - this.store = store; } diff --git a/backend/src/Squidex.Domain.Users/PwnedPasswordValidator.cs b/backend/src/Squidex.Domain.Users/PwnedPasswordValidator.cs index 8ac7d4d93..d68a302a2 100644 --- a/backend/src/Squidex.Domain.Users/PwnedPasswordValidator.cs +++ b/backend/src/Squidex.Domain.Users/PwnedPasswordValidator.cs @@ -9,7 +9,6 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using SharpPwned.NET; -using Squidex.Infrastructure; using Squidex.Infrastructure.Translations; using Squidex.Log; @@ -22,8 +21,6 @@ namespace Squidex.Domain.Users public PwnedPasswordValidator(ISemanticLog log) { - Guard.NotNull(log, nameof(log)); - this.log = log; } diff --git a/backend/src/Squidex.Infrastructure.Azure/EventSourcing/CosmosDbEventStore.cs b/backend/src/Squidex.Infrastructure.Azure/EventSourcing/CosmosDbEventStore.cs index 95c8fc632..704260f98 100644 --- a/backend/src/Squidex.Infrastructure.Azure/EventSourcing/CosmosDbEventStore.cs +++ b/backend/src/Squidex.Infrastructure.Azure/EventSourcing/CosmosDbEventStore.cs @@ -36,11 +36,6 @@ namespace Squidex.Infrastructure.EventSourcing public CosmosDbEventStore(DocumentClient documentClient, string masterKey, string database, IJsonSerializer jsonSerializer) { - Guard.NotNull(documentClient, nameof(documentClient)); - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - Guard.NotNullOrEmpty(masterKey, nameof(masterKey)); - Guard.NotNullOrEmpty(database, nameof(database)); - this.documentClient = documentClient; databaseUri = UriFactory.CreateDatabaseUri(database); diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/Diagnostics/GetEventStoreHealthCheck.cs b/backend/src/Squidex.Infrastructure.GetEventStore/Diagnostics/GetEventStoreHealthCheck.cs index 362972559..4636480f4 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/Diagnostics/GetEventStoreHealthCheck.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/Diagnostics/GetEventStoreHealthCheck.cs @@ -18,8 +18,6 @@ namespace Squidex.Infrastructure.Diagnostics public GetEventStoreHealthCheck(IEventStoreConnection connection) { - Guard.NotNull(connection, nameof(connection)); - this.connection = connection; } diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs index 929a2a23e..25c26a8a8 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs @@ -32,9 +32,6 @@ namespace Squidex.Infrastructure.EventSourcing public GetEventStore(IEventStoreConnection connection, IJsonSerializer serializer, string prefix, string projectionHost) { - Guard.NotNull(connection, nameof(connection)); - Guard.NotNull(serializer, nameof(serializer)); - this.connection = connection; this.serializer = serializer; diff --git a/backend/src/Squidex.Infrastructure.MongoDb/Diagnostics/MongoDBHealthCheck.cs b/backend/src/Squidex.Infrastructure.MongoDb/Diagnostics/MongoDBHealthCheck.cs index 3ca573dda..971b08bb1 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/Diagnostics/MongoDBHealthCheck.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/Diagnostics/MongoDBHealthCheck.cs @@ -18,8 +18,6 @@ namespace Squidex.Infrastructure.Diagnostics public MongoDBHealthCheck(IMongoDatabase mongoDatabase) { - Guard.NotNull(mongoDatabase, nameof(mongoDatabase)); - this.mongoDatabase = mongoDatabase; } diff --git a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs index aa0ad9aa4..974fb710e 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs @@ -38,8 +38,6 @@ namespace Squidex.Infrastructure.EventSourcing public MongoEventStore(IMongoDatabase database, IEventNotifier notifier) : base(database) { - Guard.NotNull(notifier, nameof(notifier)); - this.notifier = notifier; } diff --git a/backend/src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageRepository.cs b/backend/src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageRepository.cs index 26b41a69b..4837cf42f 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageRepository.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/UsageTracking/MongoUsageRepository.cs @@ -55,6 +55,8 @@ namespace Squidex.Infrastructure.UsageTracking public async Task TrackUsagesAsync(params UsageUpdate[] updates) { + Guard.NotNull(updates, nameof(updates)); + if (updates.Length == 1) { await TrackUsagesAsync(updates[0]); diff --git a/backend/src/Squidex.Infrastructure.RabbitMq/CQRS/Events/RabbitMqEventConsumer.cs b/backend/src/Squidex.Infrastructure.RabbitMq/CQRS/Events/RabbitMqEventConsumer.cs index 45cda82b3..c8add61f2 100644 --- a/backend/src/Squidex.Infrastructure.RabbitMq/CQRS/Events/RabbitMqEventConsumer.cs +++ b/backend/src/Squidex.Infrastructure.RabbitMq/CQRS/Events/RabbitMqEventConsumer.cs @@ -39,11 +39,6 @@ namespace Squidex.Infrastructure.CQRS.Events public RabbitMqEventConsumer(IJsonSerializer jsonSerializer, string eventPublisherName, string uri, string exchange, string eventsFilter) { - Guard.NotNullOrEmpty(uri, nameof(uri)); - Guard.NotNullOrEmpty(eventPublisherName, nameof(eventPublisherName)); - Guard.NotNullOrEmpty(exchange, nameof(exchange)); - Guard.NotNull(jsonSerializer, nameof(jsonSerializer)); - connectionFactory = new ConnectionFactory { Uri = new Uri(uri, UriKind.Absolute) }; connection = new Lazy(connectionFactory.CreateConnection); channel = new Lazy(connection.Value.CreateModel); diff --git a/backend/src/Squidex.Infrastructure.Redis/RedisPubSub.cs b/backend/src/Squidex.Infrastructure.Redis/RedisPubSub.cs index 74ef5c100..b6bd45ec0 100644 --- a/backend/src/Squidex.Infrastructure.Redis/RedisPubSub.cs +++ b/backend/src/Squidex.Infrastructure.Redis/RedisPubSub.cs @@ -26,10 +26,6 @@ namespace Squidex.Infrastructure public RedisPubSub(IConnectionMultiplexer redis, IJsonSerializer serializer, ISemanticLog log) { - Guard.NotNull(serializer, nameof(serializer)); - Guard.NotNull(redis, nameof(redis)); - Guard.NotNull(log, nameof(log)); - this.log = log; this.redis = redis; this.serializer = serializer; diff --git a/backend/src/Squidex.Infrastructure/Commands/CustomCommandMiddlewareRunner.cs b/backend/src/Squidex.Infrastructure/Commands/CustomCommandMiddlewareRunner.cs index 7375e871b..f5a126a13 100644 --- a/backend/src/Squidex.Infrastructure/Commands/CustomCommandMiddlewareRunner.cs +++ b/backend/src/Squidex.Infrastructure/Commands/CustomCommandMiddlewareRunner.cs @@ -17,8 +17,6 @@ namespace Squidex.Infrastructure.Commands public CustomCommandMiddlewareRunner(IEnumerable extensions) { - Guard.NotNull(extensions, nameof(extensions)); - this.extensions = extensions.Reverse().ToList(); } diff --git a/backend/src/Squidex.Infrastructure/Commands/EnrichWithTimestampCommandMiddleware.cs b/backend/src/Squidex.Infrastructure/Commands/EnrichWithTimestampCommandMiddleware.cs index 99a283796..d892fe89b 100644 --- a/backend/src/Squidex.Infrastructure/Commands/EnrichWithTimestampCommandMiddleware.cs +++ b/backend/src/Squidex.Infrastructure/Commands/EnrichWithTimestampCommandMiddleware.cs @@ -16,8 +16,6 @@ namespace Squidex.Infrastructure.Commands public EnrichWithTimestampCommandMiddleware(IClock clock) { - Guard.NotNull(clock, nameof(clock)); - this.clock = clock; } diff --git a/backend/src/Squidex.Infrastructure/Commands/GrainCommandMiddleware.cs b/backend/src/Squidex.Infrastructure/Commands/GrainCommandMiddleware.cs index 7b73acc6a..8a9b93df0 100644 --- a/backend/src/Squidex.Infrastructure/Commands/GrainCommandMiddleware.cs +++ b/backend/src/Squidex.Infrastructure/Commands/GrainCommandMiddleware.cs @@ -16,8 +16,6 @@ namespace Squidex.Infrastructure.Commands public GrainCommandMiddleware(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Infrastructure/Commands/InMemoryCommandBus.cs b/backend/src/Squidex.Infrastructure/Commands/InMemoryCommandBus.cs index 75c96da9b..9d776c4d8 100644 --- a/backend/src/Squidex.Infrastructure/Commands/InMemoryCommandBus.cs +++ b/backend/src/Squidex.Infrastructure/Commands/InMemoryCommandBus.cs @@ -48,8 +48,6 @@ namespace Squidex.Infrastructure.Commands public InMemoryCommandBus(IEnumerable middlewares) { - Guard.NotNull(middlewares, nameof(middlewares)); - var reverseMiddlewares = middlewares.Reverse().ToList(); IStep next = new NoopStep(); diff --git a/backend/src/Squidex.Infrastructure/Commands/LogCommandMiddleware.cs b/backend/src/Squidex.Infrastructure/Commands/LogCommandMiddleware.cs index 969c9a8d0..413540f79 100644 --- a/backend/src/Squidex.Infrastructure/Commands/LogCommandMiddleware.cs +++ b/backend/src/Squidex.Infrastructure/Commands/LogCommandMiddleware.cs @@ -17,8 +17,6 @@ namespace Squidex.Infrastructure.Commands public LogCommandMiddleware(ISemanticLog log) { - Guard.NotNull(log, nameof(log)); - this.log = log; } diff --git a/backend/src/Squidex.Infrastructure/Commands/ReadonlyCommandMiddleware.cs b/backend/src/Squidex.Infrastructure/Commands/ReadonlyCommandMiddleware.cs index b0ef7fa10..cbecab9b3 100644 --- a/backend/src/Squidex.Infrastructure/Commands/ReadonlyCommandMiddleware.cs +++ b/backend/src/Squidex.Infrastructure/Commands/ReadonlyCommandMiddleware.cs @@ -17,8 +17,6 @@ namespace Squidex.Infrastructure.Commands public ReadonlyCommandMiddleware(IOptions options) { - Guard.NotNull(options, nameof(options)); - this.options = options.Value; } diff --git a/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs b/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs index 454c44fec..b2fec2225 100644 --- a/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs +++ b/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs @@ -40,10 +40,6 @@ namespace Squidex.Infrastructure.Commands IEventStore eventStore, IServiceProvider serviceProvider) { - Guard.NotNull(localCache, nameof(localCache)); - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - Guard.NotNull(eventStore, nameof(eventStore)); - this.eventStore = eventStore; this.serviceProvider = serviceProvider; this.localCache = localCache; diff --git a/backend/src/Squidex.Infrastructure/Diagnostics/GCHealthCheck.cs b/backend/src/Squidex.Infrastructure/Diagnostics/GCHealthCheck.cs index 98940e086..234784986 100644 --- a/backend/src/Squidex.Infrastructure/Diagnostics/GCHealthCheck.cs +++ b/backend/src/Squidex.Infrastructure/Diagnostics/GCHealthCheck.cs @@ -20,8 +20,6 @@ namespace Squidex.Infrastructure.Diagnostics public GCHealthCheck(IOptions options) { - Guard.NotNull(options, nameof(options)); - threshold = 1024 * 1024 * options.Value.Threshold; } diff --git a/backend/src/Squidex.Infrastructure/Diagnostics/OrleansHealthCheck.cs b/backend/src/Squidex.Infrastructure/Diagnostics/OrleansHealthCheck.cs index e80ad1c83..698574412 100644 --- a/backend/src/Squidex.Infrastructure/Diagnostics/OrleansHealthCheck.cs +++ b/backend/src/Squidex.Infrastructure/Diagnostics/OrleansHealthCheck.cs @@ -19,8 +19,6 @@ namespace Squidex.Infrastructure.Diagnostics public OrleansHealthCheck(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - managementGrain = grainFactory.GetGrain(0); } diff --git a/backend/src/Squidex.Infrastructure/Email/SmtpEmailSender.cs b/backend/src/Squidex.Infrastructure/Email/SmtpEmailSender.cs index 30ce0157c..bf1dd89c8 100644 --- a/backend/src/Squidex.Infrastructure/Email/SmtpEmailSender.cs +++ b/backend/src/Squidex.Infrastructure/Email/SmtpEmailSender.cs @@ -24,8 +24,6 @@ namespace Squidex.Infrastructure.Email public SmtpEmailSender(IOptions options) { - Guard.NotNull(options, nameof(options)); - this.options = options.Value; clientPool = new DefaultObjectPoolProvider().Create(new DefaultPooledObjectPolicy()); diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/DefaultEventDataFormatter.cs b/backend/src/Squidex.Infrastructure/EventSourcing/DefaultEventDataFormatter.cs index ea71efbdb..4afdba771 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/DefaultEventDataFormatter.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/DefaultEventDataFormatter.cs @@ -20,9 +20,6 @@ namespace Squidex.Infrastructure.EventSourcing public DefaultEventDataFormatter(TypeNameRegistry typeNameRegistry, IJsonSerializer serializer) { - Guard.NotNull(typeNameRegistry, nameof(typeNameRegistry)); - Guard.NotNull(serializer, nameof(serializer)); - this.typeNameRegistry = typeNameRegistry; this.serializer = serializer; diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/EventConsumersHealthCheck.cs b/backend/src/Squidex.Infrastructure/EventSourcing/EventConsumersHealthCheck.cs index ee77093c2..019ee25e8 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/EventConsumersHealthCheck.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/EventConsumersHealthCheck.cs @@ -21,8 +21,6 @@ namespace Squidex.Infrastructure.EventSourcing public EventConsumersHealthCheck(IGrainFactory grainFactory) { - Guard.NotNull(grainFactory, nameof(grainFactory)); - this.grainFactory = grainFactory; } diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs index c7cb6846d..2a755855f 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs @@ -41,12 +41,6 @@ namespace Squidex.Infrastructure.EventSourcing.Grains IEventDataFormatter eventDataFormatter, ISemanticLog log) { - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); - Guard.NotNull(eventConsumerFactory, nameof(eventConsumerFactory)); - Guard.NotNull(state, nameof(state)); - Guard.NotNull(log, nameof(log)); - this.eventStore = eventStore; this.eventDataFormatter = eventDataFormatter; this.eventConsumerFactory = eventConsumerFactory; diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerManagerGrain.cs b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerManagerGrain.cs index 5841e66f1..6aaedbecb 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerManagerGrain.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerManagerGrain.cs @@ -32,8 +32,6 @@ namespace Squidex.Infrastructure.EventSourcing.Grains IGrainRuntime? runtime) : base(identity, runtime) { - Guard.NotNull(eventConsumers, nameof(eventConsumers)); - this.eventConsumers = eventConsumers; } diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/OrleansEventNotifier.cs b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/OrleansEventNotifier.cs index 190f030a7..49fc86a26 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/OrleansEventNotifier.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/OrleansEventNotifier.cs @@ -17,8 +17,6 @@ namespace Squidex.Infrastructure.EventSourcing.Grains public OrleansEventNotifier(IGrainFactory factory) { - Guard.NotNull(factory, nameof(factory)); - eventConsumerManagerGrain = new Lazy(() => { return factory.GetGrain(SingleGrain.Id); diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/PollingSubscription.cs b/backend/src/Squidex.Infrastructure/EventSourcing/PollingSubscription.cs index 4864762bc..98196d1bf 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/PollingSubscription.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/PollingSubscription.cs @@ -21,9 +21,6 @@ namespace Squidex.Infrastructure.EventSourcing string? streamFilter, string? position) { - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(eventSubscriber, nameof(eventSubscriber)); - timer = new CompletionTimer(5000, async ct => { try diff --git a/backend/src/Squidex.Infrastructure/Json/Newtonsoft/TypeNameSerializationBinder.cs b/backend/src/Squidex.Infrastructure/Json/Newtonsoft/TypeNameSerializationBinder.cs index b6b484f80..00dabb905 100644 --- a/backend/src/Squidex.Infrastructure/Json/Newtonsoft/TypeNameSerializationBinder.cs +++ b/backend/src/Squidex.Infrastructure/Json/Newtonsoft/TypeNameSerializationBinder.cs @@ -17,8 +17,6 @@ namespace Squidex.Infrastructure.Json.Newtonsoft public TypeNameSerializationBinder(TypeNameRegistry typeNameRegistry) { - Guard.NotNull(typeNameRegistry, nameof(typeNameRegistry)); - this.typeNameRegistry = typeNameRegistry; } diff --git a/backend/src/Squidex.Infrastructure/Log/BackgroundRequestLogStore.cs b/backend/src/Squidex.Infrastructure/Log/BackgroundRequestLogStore.cs index 0a765b168..d6ed93ddc 100644 --- a/backend/src/Squidex.Infrastructure/Log/BackgroundRequestLogStore.cs +++ b/backend/src/Squidex.Infrastructure/Log/BackgroundRequestLogStore.cs @@ -32,10 +32,6 @@ namespace Squidex.Infrastructure.Log public BackgroundRequestLogStore(IOptions options, IRequestLogRepository logRepository, ISemanticLog log) { - Guard.NotNull(options, nameof(options)); - Guard.NotNull(logRepository, nameof(logRepository)); - Guard.NotNull(log, nameof(log)); - this.options = options.Value; this.logRepository = logRepository; diff --git a/backend/src/Squidex.Infrastructure/Migrations/Migrator.cs b/backend/src/Squidex.Infrastructure/Migrations/Migrator.cs index 133353ba5..98189076a 100644 --- a/backend/src/Squidex.Infrastructure/Migrations/Migrator.cs +++ b/backend/src/Squidex.Infrastructure/Migrations/Migrator.cs @@ -23,10 +23,6 @@ namespace Squidex.Infrastructure.Migrations public Migrator(IMigrationStatus migrationStatus, IMigrationPath migrationPath, ISemanticLog log) { - Guard.NotNull(migrationStatus, nameof(migrationStatus)); - Guard.NotNull(migrationPath, nameof(migrationPath)); - Guard.NotNull(log, nameof(log)); - this.migrationStatus = migrationStatus; this.migrationPath = migrationPath; diff --git a/backend/src/Squidex.Infrastructure/Orleans/ActivationLimit.cs b/backend/src/Squidex.Infrastructure/Orleans/ActivationLimit.cs index fd261a7c8..38f1bb17f 100644 --- a/backend/src/Squidex.Infrastructure/Orleans/ActivationLimit.cs +++ b/backend/src/Squidex.Infrastructure/Orleans/ActivationLimit.cs @@ -21,9 +21,6 @@ namespace Squidex.Infrastructure.Orleans public ActivationLimit(IGrainActivationContext context, IActivationLimiter limiter) { - Guard.NotNull(context, nameof(context)); - Guard.NotNull(limiter, nameof(limiter)); - this.context = context; this.limiter = limiter; } diff --git a/backend/src/Squidex.Infrastructure/Orleans/Indexes/IdsIndexGrain.cs b/backend/src/Squidex.Infrastructure/Orleans/Indexes/IdsIndexGrain.cs index fdae2ceb2..c062e7e2c 100644 --- a/backend/src/Squidex.Infrastructure/Orleans/Indexes/IdsIndexGrain.cs +++ b/backend/src/Squidex.Infrastructure/Orleans/Indexes/IdsIndexGrain.cs @@ -18,8 +18,6 @@ namespace Squidex.Infrastructure.Orleans.Indexes public IdsIndexGrain(IGrainState state) { - Guard.NotNull(state, nameof(state)); - this.state = state; } diff --git a/backend/src/Squidex.Infrastructure/Orleans/Indexes/UniqueNameIndexGrain.cs b/backend/src/Squidex.Infrastructure/Orleans/Indexes/UniqueNameIndexGrain.cs index b55354beb..3ae13f609 100644 --- a/backend/src/Squidex.Infrastructure/Orleans/Indexes/UniqueNameIndexGrain.cs +++ b/backend/src/Squidex.Infrastructure/Orleans/Indexes/UniqueNameIndexGrain.cs @@ -19,8 +19,6 @@ namespace Squidex.Infrastructure.Orleans.Indexes public UniqueNameIndexGrain(IGrainState state) { - Guard.NotNull(state, nameof(state)); - this.state = state; } diff --git a/backend/src/Squidex.Infrastructure/Orleans/LocalCacheFilter.cs b/backend/src/Squidex.Infrastructure/Orleans/LocalCacheFilter.cs index e839eeb37..8ef6e31d7 100644 --- a/backend/src/Squidex.Infrastructure/Orleans/LocalCacheFilter.cs +++ b/backend/src/Squidex.Infrastructure/Orleans/LocalCacheFilter.cs @@ -18,8 +18,6 @@ namespace Squidex.Infrastructure.Orleans public LocalCacheFilter(ILocalCache localCache) { - Guard.NotNull(localCache, nameof(localCache)); - this.localCache = localCache; } diff --git a/backend/src/Squidex.Infrastructure/Orleans/LoggingFilter.cs b/backend/src/Squidex.Infrastructure/Orleans/LoggingFilter.cs index 7079723ab..d9944edc9 100644 --- a/backend/src/Squidex.Infrastructure/Orleans/LoggingFilter.cs +++ b/backend/src/Squidex.Infrastructure/Orleans/LoggingFilter.cs @@ -18,8 +18,6 @@ namespace Squidex.Infrastructure.Orleans public LoggingFilter(ISemanticLog log) { - Guard.NotNull(log, nameof(log)); - this.log = log; } diff --git a/backend/src/Squidex.Infrastructure/Orleans/StateFilter.cs b/backend/src/Squidex.Infrastructure/Orleans/StateFilter.cs index 78332e218..73a2e69e1 100644 --- a/backend/src/Squidex.Infrastructure/Orleans/StateFilter.cs +++ b/backend/src/Squidex.Infrastructure/Orleans/StateFilter.cs @@ -19,8 +19,6 @@ namespace Squidex.Infrastructure.Orleans public StateFilter(IGrainRuntime runtime) { - Guard.NotNull(runtime, nameof(runtime)); - this.runtime = runtime; } diff --git a/backend/src/Squidex.Infrastructure/States/Store.cs b/backend/src/Squidex.Infrastructure/States/Store.cs index f73fef2cc..ab1982237 100644 --- a/backend/src/Squidex.Infrastructure/States/Store.cs +++ b/backend/src/Squidex.Infrastructure/States/Store.cs @@ -24,11 +24,6 @@ namespace Squidex.Infrastructure.States IEventDataFormatter eventDataFormatter, IStreamNameResolver streamNameResolver) { - Guard.NotNull(snapshotStore, nameof(snapshotStore)); - Guard.NotNull(eventStore, nameof(eventStore)); - Guard.NotNull(eventDataFormatter, nameof(eventDataFormatter)); - Guard.NotNull(streamNameResolver, nameof(streamNameResolver)); - this.snapshotStore = snapshotStore; this.eventStore = eventStore; this.eventDataFormatter = eventDataFormatter; diff --git a/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs b/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs index 102d3177f..df345ceba 100644 --- a/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs +++ b/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs @@ -21,8 +21,6 @@ namespace Squidex.Infrastructure.Translations public ResourcesLocalizer(ResourceManager resourceManager) { - Guard.NotNull(resourceManager, nameof(resourceManager)); - this.resourceManager = resourceManager; } diff --git a/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs b/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs index bb775b16f..e0815a25d 100644 --- a/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs +++ b/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs @@ -27,9 +27,6 @@ namespace Squidex.Infrastructure.UsageTracking public BackgroundUsageTracker(IUsageRepository usageRepository, ISemanticLog log) { - Guard.NotNull(usageRepository, nameof(usageRepository)); - Guard.NotNull(log, nameof(log)); - this.usageRepository = usageRepository; this.log = log; diff --git a/backend/src/Squidex.Web/ApiController.cs b/backend/src/Squidex.Web/ApiController.cs index d8734329b..e5244d4b8 100644 --- a/backend/src/Squidex.Web/ApiController.cs +++ b/backend/src/Squidex.Web/ApiController.cs @@ -73,8 +73,6 @@ namespace Squidex.Web protected ApiController(ICommandBus commandBus) { - Guard.NotNull(commandBus, nameof(commandBus)); - CommandBus = commandBus; resources = new Lazy(() => new Resources(this)); diff --git a/backend/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs b/backend/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs index 9a465bc49..123f26053 100644 --- a/backend/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs +++ b/backend/src/Squidex.Web/CommandMiddlewares/ETagCommandMiddleware.cs @@ -22,8 +22,6 @@ namespace Squidex.Web.CommandMiddlewares public ETagCommandMiddleware(IHttpContextAccessor httpContextAccessor) { - Guard.NotNull(httpContextAccessor, nameof(httpContextAccessor)); - this.httpContextAccessor = httpContextAccessor; } diff --git a/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithActorCommandMiddleware.cs b/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithActorCommandMiddleware.cs index e9afa0abc..26e800b4f 100644 --- a/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithActorCommandMiddleware.cs +++ b/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithActorCommandMiddleware.cs @@ -20,8 +20,6 @@ namespace Squidex.Web.CommandMiddlewares public EnrichWithActorCommandMiddleware(IHttpContextAccessor httpContextAccessor) { - Guard.NotNull(httpContextAccessor, nameof(httpContextAccessor)); - this.httpContextAccessor = httpContextAccessor; } diff --git a/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithAppIdCommandMiddleware.cs b/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithAppIdCommandMiddleware.cs index 769a0c931..090bb21e4 100644 --- a/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithAppIdCommandMiddleware.cs +++ b/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithAppIdCommandMiddleware.cs @@ -20,8 +20,6 @@ namespace Squidex.Web.CommandMiddlewares public EnrichWithAppIdCommandMiddleware(IContextProvider contextProvider) { - Guard.NotNull(contextProvider, nameof(contextProvider)); - this.contextProvider = contextProvider; } diff --git a/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithSchemaIdCommandMiddleware.cs b/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithSchemaIdCommandMiddleware.cs index e8bcbaf51..c47ffb723 100644 --- a/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithSchemaIdCommandMiddleware.cs +++ b/backend/src/Squidex.Web/CommandMiddlewares/EnrichWithSchemaIdCommandMiddleware.cs @@ -21,8 +21,6 @@ namespace Squidex.Web.CommandMiddlewares public EnrichWithSchemaIdCommandMiddleware(IHttpContextAccessor httpContextAccessor) { - Guard.NotNull(httpContextAccessor, nameof(httpContextAccessor)); - this.httpContextAccessor = httpContextAccessor; } diff --git a/backend/src/Squidex.Web/ContextProvider.cs b/backend/src/Squidex.Web/ContextProvider.cs index b2e4a9605..1ef8c51b8 100644 --- a/backend/src/Squidex.Web/ContextProvider.cs +++ b/backend/src/Squidex.Web/ContextProvider.cs @@ -8,7 +8,6 @@ using System.Threading; using Microsoft.AspNetCore.Http; using Squidex.Domain.Apps.Entities; -using Squidex.Infrastructure; namespace Squidex.Web { @@ -37,8 +36,6 @@ namespace Squidex.Web public ContextProvider(IHttpContextAccessor httpContextAccessor) { - Guard.NotNull(httpContextAccessor, nameof(httpContextAccessor)); - this.httpContextAccessor = httpContextAccessor; } } diff --git a/backend/src/Squidex.Web/Pipeline/ActionContextLogAppender.cs b/backend/src/Squidex.Web/Pipeline/ActionContextLogAppender.cs index e37041e65..146d84b3f 100644 --- a/backend/src/Squidex.Web/Pipeline/ActionContextLogAppender.cs +++ b/backend/src/Squidex.Web/Pipeline/ActionContextLogAppender.cs @@ -9,7 +9,6 @@ using System; using System.Diagnostics; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Infrastructure; -using Squidex.Infrastructure; using Squidex.Log; namespace Squidex.Web.Pipeline @@ -21,9 +20,6 @@ namespace Squidex.Web.Pipeline public ActionContextLogAppender(IActionContextAccessor actionContextAccessor, IHttpContextAccessor httpContextAccessor) { - Guard.NotNull(actionContextAccessor, nameof(actionContextAccessor)); - Guard.NotNull(httpContextAccessor, nameof(httpContextAccessor)); - this.actionContextAccessor = actionContextAccessor; this.httpContextAccessor = httpContextAccessor; diff --git a/backend/src/Squidex.Web/Pipeline/ApiCostsFilter.cs b/backend/src/Squidex.Web/Pipeline/ApiCostsFilter.cs index 038ebede3..0730999ef 100644 --- a/backend/src/Squidex.Web/Pipeline/ApiCostsFilter.cs +++ b/backend/src/Squidex.Web/Pipeline/ApiCostsFilter.cs @@ -11,7 +11,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Squidex.Domain.Apps.Entities.Apps.Plans; -using Squidex.Infrastructure; using Squidex.Log; namespace Squidex.Web.Pipeline @@ -22,8 +21,6 @@ namespace Squidex.Web.Pipeline public ApiCostsFilter(UsageGate usageGate) { - Guard.NotNull(usageGate, nameof(usageGate)); - this.usageGate = usageGate; } diff --git a/backend/src/Squidex.Web/Pipeline/AppResolver.cs b/backend/src/Squidex.Web/Pipeline/AppResolver.cs index 87eb0644b..eeecd45e6 100644 --- a/backend/src/Squidex.Web/Pipeline/AppResolver.cs +++ b/backend/src/Squidex.Web/Pipeline/AppResolver.cs @@ -16,7 +16,6 @@ using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.DependencyInjection; using Squidex.Domain.Apps.Entities; using Squidex.Domain.Apps.Entities.Apps; -using Squidex.Infrastructure; using Squidex.Infrastructure.Security; using Squidex.Log; using Squidex.Shared; @@ -30,8 +29,6 @@ namespace Squidex.Web.Pipeline public AppResolver(IAppProvider appProvider) { - Guard.NotNull(appProvider, nameof(appProvider)); - this.appProvider = appProvider; } diff --git a/backend/src/Squidex.Web/Pipeline/CachingFilter.cs b/backend/src/Squidex.Web/Pipeline/CachingFilter.cs index 295ba28f4..29b538c37 100644 --- a/backend/src/Squidex.Web/Pipeline/CachingFilter.cs +++ b/backend/src/Squidex.Web/Pipeline/CachingFilter.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Net.Http.Headers; -using Squidex.Infrastructure; namespace Squidex.Web.Pipeline { @@ -21,8 +20,6 @@ namespace Squidex.Web.Pipeline public CachingFilter(CachingManager cachingManager) { - Guard.NotNull(cachingManager, nameof(cachingManager)); - this.cachingManager = cachingManager; } diff --git a/backend/src/Squidex.Web/Pipeline/CachingKeysMiddleware.cs b/backend/src/Squidex.Web/Pipeline/CachingKeysMiddleware.cs index 9cd742a71..fd3e083c0 100644 --- a/backend/src/Squidex.Web/Pipeline/CachingKeysMiddleware.cs +++ b/backend/src/Squidex.Web/Pipeline/CachingKeysMiddleware.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; -using Squidex.Infrastructure; using Squidex.Infrastructure.Security; namespace Squidex.Web.Pipeline @@ -23,10 +22,6 @@ namespace Squidex.Web.Pipeline public CachingKeysMiddleware(CachingManager cachingManager, IOptions cachingOptions, RequestDelegate next) { - Guard.NotNull(cachingManager, nameof(cachingManager)); - Guard.NotNull(cachingOptions, nameof(cachingOptions)); - Guard.NotNull(next, nameof(next)); - this.cachingOptions = cachingOptions.Value; this.cachingManager = cachingManager; diff --git a/backend/src/Squidex.Web/Pipeline/CachingManager.cs b/backend/src/Squidex.Web/Pipeline/CachingManager.cs index 4dc6e95ec..35e71dbfe 100644 --- a/backend/src/Squidex.Web/Pipeline/CachingManager.cs +++ b/backend/src/Squidex.Web/Pipeline/CachingManager.cs @@ -172,9 +172,6 @@ namespace Squidex.Web.Pipeline public CachingManager(IHttpContextAccessor httpContextAccessor, IOptions cachingOptions) { - Guard.NotNull(httpContextAccessor, nameof(httpContextAccessor)); - Guard.NotNull(cachingOptions, nameof(cachingOptions)); - this.httpContextAccessor = httpContextAccessor; this.cachingOptions = cachingOptions.Value; diff --git a/backend/src/Squidex.Web/Pipeline/UsageMiddleware.cs b/backend/src/Squidex.Web/Pipeline/UsageMiddleware.cs index bb391da73..42450e072 100644 --- a/backend/src/Squidex.Web/Pipeline/UsageMiddleware.cs +++ b/backend/src/Squidex.Web/Pipeline/UsageMiddleware.cs @@ -24,10 +24,6 @@ namespace Squidex.Web.Pipeline public UsageMiddleware(IAppLogStore usageLog, IApiUsageTracker usageTracker, IClock clock) { - Guard.NotNull(usageLog, nameof(usageLog)); - Guard.NotNull(usageTracker, nameof(usageTracker)); - Guard.NotNull(clock, nameof(clock)); - this.usageLog = usageLog; this.usageTracker = usageTracker; diff --git a/backend/src/Squidex.Web/Services/StringLocalizer.cs b/backend/src/Squidex.Web/Services/StringLocalizer.cs index 15a0b1362..7ce6c24bd 100644 --- a/backend/src/Squidex.Web/Services/StringLocalizer.cs +++ b/backend/src/Squidex.Web/Services/StringLocalizer.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using Microsoft.Extensions.Localization; -using Squidex.Infrastructure; using Squidex.Infrastructure.Translations; using Squidex.Text; @@ -79,8 +78,6 @@ namespace Squidex.Web.Services private StringLocalizer(ILocalizer translationService, CultureInfo? culture) { - Guard.NotNull(translationService, nameof(translationService)); - this.translationService = translationService; this.culture = culture; diff --git a/backend/src/Squidex.Web/Services/UrlGenerator.cs b/backend/src/Squidex.Web/Services/UrlGenerator.cs index c732c0327..8796fcc67 100644 --- a/backend/src/Squidex.Web/Services/UrlGenerator.cs +++ b/backend/src/Squidex.Web/Services/UrlGenerator.cs @@ -22,9 +22,6 @@ namespace Squidex.Web.Services public UrlGenerator(IGenericUrlGenerator urlGenerator, IAssetFileStore assetFileStore, bool allowAssetSourceUrl) { - Guard.NotNull(assetFileStore, nameof(assetFileStore)); - Guard.NotNull(urlGenerator, nameof(urlGenerator)); - this.assetFileStore = assetFileStore; this.urlGenerator = urlGenerator; diff --git a/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionProcessor.cs b/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionProcessor.cs index 53ec76ecb..9e5fcafff 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionProcessor.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionProcessor.cs @@ -14,7 +14,6 @@ using NSwag.Generation.Processors.Contexts; using Squidex.Domain.Apps.Core.GenerateJsonSchema; using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.Rules; -using Squidex.Infrastructure; namespace Squidex.Areas.Api.Controllers.Rules.Models { @@ -24,8 +23,6 @@ namespace Squidex.Areas.Api.Controllers.Rules.Models public RuleActionProcessor(RuleRegistry ruleRegistry) { - Guard.NotNull(ruleRegistry, nameof(ruleRegistry)); - this.ruleRegistry = ruleRegistry; } diff --git a/backend/src/Squidex/Areas/IdentityServer/Config/DynamicApplicationStore.cs b/backend/src/Squidex/Areas/IdentityServer/Config/DynamicApplicationStore.cs index 0f71b8283..ccb1ba2f5 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Config/DynamicApplicationStore.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Config/DynamicApplicationStore.cs @@ -33,8 +33,6 @@ namespace Squidex.Areas.IdentityServer.Config public DynamicApplicationStore(IServiceProvider serviceProvider) : base(CreateStaticClients(serviceProvider)) { - Guard.NotNull(serviceProvider, nameof(serviceProvider)); - this.serviceProvider = serviceProvider; } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DefaultAssetFileStoreTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DefaultAssetFileStoreTests.cs index 7a43b5e0d..c82a0b3d2 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DefaultAssetFileStoreTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/DefaultAssetFileStoreTests.cs @@ -9,6 +9,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; using FakeItEasy; +using Microsoft.Extensions.Options; using Squidex.Assets; using Squidex.Infrastructure; using Xunit; @@ -23,14 +24,17 @@ namespace Squidex.Domain.Apps.Entities.Assets private readonly long assetFileVersion = 21; private readonly string fileNameOld; private readonly string fileNameNew; + private readonly string fileNameFolder; + private readonly AssetOptions options = new AssetOptions(); private readonly DefaultAssetFileStore sut; public DefaultAssetFileStoreTests() { fileNameOld = $"{assetId}_{assetFileVersion}"; fileNameNew = $"{appId}_{assetId}_{assetFileVersion}"; + fileNameFolder = $"{appId}/{assetId}_{assetFileVersion}"; - sut = new DefaultAssetFileStore(assetStore); + sut = new DefaultAssetFileStore(assetStore, Options.Create(options)); } [Fact] @@ -89,6 +93,8 @@ namespace Squidex.Domain.Apps.Entities.Assets [Fact] public async Task Should_upload_file_to_store() { + options.FolderPerApp = false; + var stream = new MemoryStream(); await sut.UploadAsync(appId, assetId, assetFileVersion, stream); @@ -97,6 +103,19 @@ namespace Squidex.Domain.Apps.Entities.Assets .MustHaveHappened(); } + [Fact] + public async Task Should_upload_file_to_store_with_folder() + { + options.FolderPerApp = true; + + var stream = new MemoryStream(); + + await sut.UploadAsync(appId, assetId, assetFileVersion, stream); + + A.CallTo(() => assetStore.UploadAsync(fileNameFolder, stream, true, CancellationToken.None)) + .MustHaveHappened(); + } + [Fact] public async Task Should_download_file_from_store() {