Remove unused index provider
This commit is contained in:
parent
884f54782d
commit
13b770e362
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using Elsa.Activities.Http;
|
||||
using Elsa.Activities.Http.Indexes;
|
||||
using Elsa.Activities.Http.Options;
|
||||
using Elsa.Activities.Http.Parsers;
|
||||
using Elsa.Activities.Http.RequestHandlers.Handlers;
|
||||
|
|
@ -41,8 +40,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
.AddSingleton<IActionContextAccessor, ActionContextAccessor>()
|
||||
.AddSingleton<IAbsoluteUrlProvider, DefaultAbsoluteUrlProvider>()
|
||||
.AddTriggerProvider<ReceiveHttpRequestTriggerProvider>()
|
||||
.AddIndexProvider<WorkflowInstanceByReceiveHttpRequestIndexProvider>()
|
||||
.AddDataMigration<Migrations>()
|
||||
.AddHttpContextAccessor()
|
||||
.AddNotificationHandlers(typeof(ServiceCollectionExtensions))
|
||||
.AddDataProtection();
|
||||
|
|
|
|||
|
|
@ -8,11 +8,9 @@ namespace Elsa.Activities.Http.Extensions
|
|||
{
|
||||
public static async Task<byte[]> ReadBytesToEndAsync(this Stream input, CancellationToken cancellationToken)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
await input.CopyToAsync(ms, 16 * 1024, cancellationToken);
|
||||
return ms.ToArray();
|
||||
}
|
||||
using var ms = new MemoryStream();
|
||||
await input.CopyToAsync(ms, 16 * 1024, cancellationToken);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
using System.Linq;
|
||||
using Elsa.Data;
|
||||
using Elsa.Models;
|
||||
using YesSql.Indexes;
|
||||
|
||||
namespace Elsa.Activities.Http.Indexes
|
||||
{
|
||||
public class WorkflowInstanceByReceiveHttpRequestIndex : MapIndex
|
||||
{
|
||||
public string ActivityId { get; set; } = default!;
|
||||
public string RequestPath { get; set; } = default!;
|
||||
public string? RequestMethod { get; set; }
|
||||
}
|
||||
|
||||
public class WorkflowInstanceByReceiveHttpRequestIndexProvider : IndexProvider<WorkflowInstance>
|
||||
{
|
||||
public WorkflowInstanceByReceiveHttpRequestIndexProvider() => CollectionName = CollectionNames.WorkflowInstances;
|
||||
|
||||
public override void Describe(DescribeContext<WorkflowInstance> context)
|
||||
{
|
||||
context.For<WorkflowInstanceByReceiveHttpRequestIndex>()
|
||||
.Map(
|
||||
workflowInstance => workflowInstance.BlockingActivities
|
||||
.Where(x => x.ActivityType == nameof(ReceiveHttpRequest))
|
||||
.Select(
|
||||
blockingActivity =>
|
||||
{
|
||||
var activity = workflowInstance.Activities
|
||||
.First(x => x.Id == blockingActivity.ActivityId);
|
||||
|
||||
var path = activity.Data.Value<string>(nameof(ReceiveHttpRequest.Path));
|
||||
var method = activity.Data.Value<string>(nameof(ReceiveHttpRequest.Method));
|
||||
|
||||
return new WorkflowInstanceByReceiveHttpRequestIndex
|
||||
{
|
||||
ActivityId = blockingActivity.ActivityId,
|
||||
RequestPath = path,
|
||||
RequestMethod = method
|
||||
};
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
using Elsa.Activities.Http.Indexes;
|
||||
using Elsa.Data;
|
||||
using YesSql.Sql;
|
||||
|
||||
namespace Elsa.Activities.Http
|
||||
{
|
||||
public class Migrations : DataMigration
|
||||
{
|
||||
public int Create()
|
||||
{
|
||||
SchemaBuilder.CreateMapIndexTable<WorkflowInstanceByReceiveHttpRequestIndex>(
|
||||
table => table
|
||||
.Column<string>("ActivityId")
|
||||
.Column<string>("RequestPath")
|
||||
.Column<string?>("RequestMethod"),
|
||||
CollectionNames.WorkflowInstances);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,6 @@ using Rebus.Persistence.InMem;
|
|||
using Rebus.Routing.TypeBased;
|
||||
using Rebus.Transport.InMem;
|
||||
using YesSql;
|
||||
using Elsa.YesSql.Provider.Sqlite.InMemory;
|
||||
using Storage.Net;
|
||||
using Storage.Net.Blobs;
|
||||
using YesSql.Provider.Sqlite;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
using System.Data;
|
||||
using Elsa.Samples.ContextualWorkflowHttp.Indexes;
|
||||
using Elsa.Samples.ContextualWorkflowHttp.WorkflowContextProviders;
|
||||
using Elsa.Samples.ContextualWorkflowHttp.Workflows;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using YesSql.Provider.Sqlite;
|
||||
|
||||
namespace Elsa.Samples.ContextualWorkflowHttp
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
using System.Data;
|
||||
using Elsa.Samples.CorrelationHttp.Workflows;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using YesSql.Provider.Sqlite;
|
||||
|
||||
namespace Elsa.Samples.CorrelationHttp
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.Models;
|
||||
using Elsa.Scripting.Liquid.Services;
|
||||
using Elsa.Serialization;
|
||||
using Elsa.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using YesSql.Provider.Sqlite;
|
||||
|
||||
namespace Elsa.Samples.DeclarativeCompositeActivitiesConsole
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
using System.Data;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using YesSql.Provider.Sqlite;
|
||||
|
||||
namespace Elsa.Samples.HelloWorldConsole
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
using System.Data;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.Samples.ProgrammaticCompositeActivitiesConsole.Activities;
|
||||
using Elsa.Samples.ProgrammaticCompositeActivitiesConsole.Workflows;
|
||||
using Elsa.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using YesSql.Provider.Sqlite;
|
||||
|
||||
namespace Elsa.Samples.ProgrammaticCompositeActivitiesConsole
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using System.Threading.Tasks;
|
||||
using Elsa.Activities.Console;
|
||||
using Elsa.Models;
|
||||
|
|
@ -7,7 +6,6 @@ using Elsa.Scripting.Liquid.Services;
|
|||
using Elsa.Serialization;
|
||||
using Elsa.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using YesSql.Provider.Sqlite;
|
||||
|
||||
namespace Elsa.Samples.Serialization
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue