Remove unnecessary namespace declarations and using statements

This commit consolidates namespaces by removing redundant declarations and unused using statements across multiple files. This helps to streamline the code and improve readability, reducing potential confusion.
This commit is contained in:
Sipke Schoorstra 2024-07-24 22:51:06 +02:00
parent 4f288f499b
commit e1bb6a52d2
19 changed files with 12 additions and 26 deletions

View file

@ -1,4 +1,5 @@
using Elsa.Abstractions;
using Elsa.Workflows.Runtime;
using Elsa.Workflows.Runtime.Contracts;
using Elsa.Workflows.Runtime.Requests;
using Elsa.Workflows.Runtime.Responses;

View file

@ -1,4 +1,5 @@
using Elsa.Abstractions;
using Elsa.Workflows.Runtime;
using Elsa.Workflows.Runtime.Contracts;
using JetBrains.Annotations;

View file

@ -1,6 +1,6 @@
using Elsa.Common.Contracts;
namespace Elsa.Workflows.Runtime.Contracts;
namespace Elsa.Workflows.Runtime;
/// Represents a store of log records.
public interface ILogRecordStore<in T> where T : ILogRecord

View file

@ -1,7 +1,7 @@
using Elsa.Workflows.Runtime.Requests;
using Elsa.Workflows.Runtime.Responses;
namespace Elsa.Workflows.Runtime.Contracts;
namespace Elsa.Workflows.Runtime;
/// Refreshes all workflows by re-indexing their triggers.
public interface IWorkflowDefinitionsRefresher

View file

@ -1,4 +1,4 @@
namespace Elsa.Workflows.Runtime.Contracts;
namespace Elsa.Workflows.Runtime;
/// Reloads all workflows by invoking the populator.
public interface IWorkflowDefinitionsReloader

View file

@ -1,5 +1,4 @@
using Elsa.Workflows;
using Elsa.Workflows.Contracts;
using Elsa.Workflows.Pipelines.ActivityExecution;
using Elsa.Workflows.Runtime.Middleware.Activities;

View file

@ -2,7 +2,6 @@ using Elsa.Caching.Features;
using Elsa.Features.Abstractions;
using Elsa.Features.Attributes;
using Elsa.Features.Services;
using Elsa.Workflows.Runtime.Contracts;
using Elsa.Workflows.Runtime.Handlers;
using Elsa.Workflows.Runtime.Stores;
using Microsoft.Extensions.DependencyInjection;

View file

@ -12,7 +12,6 @@ using Elsa.Workflows.Management;
using Elsa.Workflows.Management.Contracts;
using Elsa.Workflows.Management.Services;
using Elsa.Workflows.Runtime.ActivationValidators;
using Elsa.Workflows.Runtime.Contracts;
using Elsa.Workflows.Runtime.Entities;
using Elsa.Workflows.Runtime.Handlers;
using Elsa.Workflows.Runtime.HostedServices;

View file

@ -5,7 +5,6 @@ using Elsa.Workflows.Middleware.Activities;
using Elsa.Workflows.Models;
using Elsa.Workflows.Options;
using Elsa.Workflows.Pipelines.ActivityExecution;
using Elsa.Workflows.Runtime.Middleware.Workflows;
using Elsa.Workflows.Runtime.Stimuli;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;

View file

@ -9,12 +9,7 @@ public class PersistActivityExecutionLogMiddleware(WorkflowMiddlewareDelegate ne
/// <inheritdoc />
public override async ValueTask InvokeAsync(WorkflowExecutionContext context)
{
// Invoke next middleware.
await Next(context);
// Get the managed cancellation token.
var cancellationToken = context.CancellationTokens.SystemCancellationToken;
await sink.PersistExecutionLogsAsync(context, cancellationToken);
await sink.PersistExecutionLogsAsync(context);
}
}

View file

@ -1,5 +1,3 @@
using Elsa.Workflows.Management.Entities;
namespace Elsa.Workflows.Runtime.Responses;
/// Represents a response to a request to refresh workflow definitions.

View file

@ -1,7 +1,6 @@
using Elsa.Workflows.Runtime.Contracts;
using Elsa.Workflows.Runtime.Entities;
namespace Elsa.Workflows.Runtime.Services;
namespace Elsa.Workflows.Runtime;
/// Extracts activity execution log records.
public class ActivityExecutionRecordExtractor(IActivityExecutionMapper activityExecutionMapper) : ILogRecordExtractor<ActivityExecutionRecord>

View file

@ -1,5 +1,4 @@
using Elsa.Mediator.Contracts;
using Elsa.Workflows.Runtime.Contracts;
using Elsa.Workflows.Runtime.Entities;
using Elsa.Workflows.Runtime.Notifications;

View file

@ -1,5 +1,4 @@
using Elsa.Mediator.Contracts;
using Elsa.Workflows.Runtime.Contracts;
using Elsa.Workflows.Runtime.Entities;
using Elsa.Workflows.Runtime.Notifications;
@ -14,7 +13,7 @@ public class StoreWorkflowExecutionLogSink(IWorkflowExecutionLogStore store, ILo
public async Task PersistExecutionLogsAsync(WorkflowExecutionContext context, CancellationToken cancellationToken)
{
var records = extractor.ExtractLogRecords(context).ToList();
await store.AddManyAsync(records, context.CancellationTokens.SystemCancellationToken);
await notificationSender.SendAsync(new WorkflowExecutionLogUpdated(context), context.CancellationTokens.SystemCancellationToken);
await store.AddManyAsync(records, context.CancellationToken);
await notificationSender.SendAsync(new WorkflowExecutionLogUpdated(context), context.CancellationToken);
}
}

View file

@ -4,7 +4,6 @@ using Elsa.Mediator.Contracts;
using Elsa.Workflows.Management;
using Elsa.Workflows.Management.Entities;
using Elsa.Workflows.Management.Filters;
using Elsa.Workflows.Runtime.Contracts;
using Elsa.Workflows.Runtime.Notifications;
using Elsa.Workflows.Runtime.Requests;
using Elsa.Workflows.Runtime.Responses;

View file

@ -1,9 +1,8 @@
using Elsa.Mediator.Contracts;
using Elsa.Workflows.Runtime.Contracts;
using Elsa.Workflows.Runtime.Models;
using Elsa.Workflows.Runtime.Notifications;
namespace Elsa.Workflows.Runtime.Services;
namespace Elsa.Workflows.Runtime;
/// <inheritdoc />
public class WorkflowDefinitionsReloader(IWorkflowDefinitionStorePopulator workflowDefinitionStorePopulator, INotificationSender notificationSender) : IWorkflowDefinitionsReloader

View file

@ -1,7 +1,7 @@
using Elsa.Workflows.Contracts;
using Elsa.Workflows.Runtime.Entities;
namespace Elsa.Workflows.Runtime.Services;
namespace Elsa.Workflows.Runtime;
/// <inheritdoc />
public class WorkflowExecutionLogRecordExtractor(IIdentityGenerator identityGenerator) : ILogRecordExtractor<WorkflowExecutionLogRecord>

View file

@ -1,4 +1,3 @@
using Elsa.Common.Entities;
using Elsa.Common.Models;
using Elsa.Common.Services;
using Elsa.Extensions;

View file

@ -1,6 +1,7 @@
using System.Net;
using Elsa.Testing.Shared.Services;
using Elsa.Workflows.ComponentTests.Helpers;
using Elsa.Workflows.Runtime;
using Elsa.Workflows.Runtime.Contracts;
using Microsoft.Extensions.DependencyInjection;