Fix gRPC serialization
This commit is contained in:
parent
be92fe7d74
commit
0038702dd8
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Text.Json;
|
|
||||||
using Elsa.Client.Models;
|
using Elsa.Client.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using JsonSerializer = Newtonsoft.Json.JsonSerializer;
|
using JsonSerializer = Newtonsoft.Json.JsonSerializer;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="NodaTime" Version="3.0.3" />
|
<PackageReference Include="NodaTime" Version="3.0.3" />
|
||||||
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
|
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
|
||||||
|
<PackageReference Include="protobuf-net.Core" Version="3.0.52" />
|
||||||
<PackageReference Include="Refit" Version="5.2.1" />
|
<PackageReference Include="Refit" Version="5.2.1" />
|
||||||
<PackageReference Include="Refit.HttpClientFactory" Version="5.2.1" />
|
<PackageReference Include="Refit.HttpClientFactory" Version="5.2.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,17 @@
|
||||||
using System;
|
using ProtoBuf;
|
||||||
|
|
||||||
namespace Elsa.Client.Models
|
namespace Elsa.Client.Models
|
||||||
{
|
{
|
||||||
|
[ProtoContract]
|
||||||
public class ActivityDescriptor
|
public class ActivityDescriptor
|
||||||
{
|
{
|
||||||
public string Type { get; set; } = default!;
|
[ProtoMember(1)] public string Type { get; set; } = default!;
|
||||||
public string DisplayName { get; set; } = default!;
|
[ProtoMember(2)] public string DisplayName { get; set; } = default!;
|
||||||
public string? Description { get; set; }
|
[ProtoMember(3)] public string? Description { get; set; }
|
||||||
public string? RuntimeDescription { get; set; }
|
[ProtoMember(4)] public string? RuntimeDescription { get; set; }
|
||||||
public string Category { get; set; } = default!;
|
[ProtoMember(5)] public string Category { get; set; } = default!;
|
||||||
public string? Icon { get; set; }
|
[ProtoMember(6)] public string? Icon { get; set; }
|
||||||
public string[] Outcomes { get; set; } = new string[0];
|
[ProtoMember(7)] public string[] Outcomes { get; set; } = new string[0];
|
||||||
public ActivityPropertyDescriptor[] Properties { get; set; } = new ActivityPropertyDescriptor[0];
|
[ProtoMember(8)] public ActivityPropertyDescriptor[] Properties { get; set; } = new ActivityPropertyDescriptor[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
using ProtoBuf;
|
||||||
|
|
||||||
namespace Elsa.Client.Models
|
namespace Elsa.Client.Models
|
||||||
{
|
{
|
||||||
|
[ProtoContract(IgnoreListHandling = true)]
|
||||||
public class ActivityPropertyDescriptor
|
public class ActivityPropertyDescriptor
|
||||||
{
|
{
|
||||||
public string Name { get; } = default!;
|
[ProtoMember(1)] public string Name { get; } = default!;
|
||||||
public string Type { get; } = default!;
|
[ProtoMember(2)] public string Type { get; } = default!;
|
||||||
public string? Label { get; set; }
|
[ProtoMember(3)] public string? Label { get; set; }
|
||||||
public string? Hint { get; set;}
|
[ProtoMember(4)] public string? Hint { get; set; }
|
||||||
public JObject? Options { get; set;}
|
[ProtoMember(5)] public JObject? Options { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Elsa.Client.Models
|
namespace Elsa.Client.Models
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ElsaDashboard.Application.WebAssembly\ElsaDashboard.Application.WebAssembly.csproj" />
|
||||||
<ProjectReference Include="..\ElsaDashboard.Application\ElsaDashboard.Application.csproj" />
|
<ProjectReference Include="..\ElsaDashboard.Application\ElsaDashboard.Application.csproj" />
|
||||||
<ProjectReference Include="..\ElsaDashboard.Backend\ElsaDashboard.Backend.csproj" />
|
<ProjectReference Include="..\ElsaDashboard.Backend\ElsaDashboard.Backend.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ElsaDashboard.Application.Server.Pages
|
namespace ElsaDashboard.Application.Server.Pages
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace ElsaDashboard.Application.Server
|
||||||
{
|
{
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
public static bool UseBlazorServer = true;
|
public static bool UseBlazorServer = false;
|
||||||
public static bool UseBlazorWebAssembly => !UseBlazorServer;
|
public static bool UseBlazorWebAssembly => !UseBlazorServer;
|
||||||
public static RenderMode RenderMode => UseBlazorServer ? RenderMode.ServerPrerendered: RenderMode.WebAssemblyPrerendered;
|
public static RenderMode RenderMode => UseBlazorServer ? RenderMode.ServerPrerendered: RenderMode.WebAssemblyPrerendered;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,18 +44,17 @@ namespace ElsaDashboard.Application.Server
|
||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
|
||||||
|
|
||||||
if(Program.UseBlazorWebAssembly)
|
if(Program.UseBlazorWebAssembly)
|
||||||
app.UseBlazorFrameworkFiles();
|
app.UseBlazorFrameworkFiles();
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
app.UserElsaGrpcServices();
|
app.UseElsaGrpcServices();
|
||||||
app.UseEndpoints(endpoints =>
|
app.UseEndpoints(endpoints =>
|
||||||
{
|
{
|
||||||
if(Program.UseBlazorServer)
|
if(Program.UseBlazorServer)
|
||||||
endpoints.MapBlazorHub();
|
endpoints.MapBlazorHub();
|
||||||
|
|
||||||
endpoints.MapFallbackToPage("/_Host");
|
endpoints.MapFallbackToPage("/_Host");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
@using ElsaDashboard.Application.Models
|
|
||||||
<Router AppAssembly="@typeof(MenuItem).Assembly">
|
<Router AppAssembly="@typeof(MenuItem).Assembly">
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ namespace ElsaDashboard.Application.Pages.Designer
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
var activities = (await ActivityService.GetActivitiesAsync()).ToList();
|
var response = (await ActivityService.GetActivitiesAsync());
|
||||||
ActivityGroupings = activities.GroupBy(x => x.Category).ToList();
|
ActivityGroupings = response.Activities.GroupBy(x => x.Category).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div x-show="$store.flyoutPanel.show" x-data="{ open: false }" x-on:keydown.window.escape="$store.flyoutPanel.show = false" class="fixed inset-0 overflow-hidden">
|
<div x-show="$store.flyoutPanel.show" x-data="{}" x-on:keydown.window.escape="$store.flyoutPanel.show = false" class="fixed inset-0 overflow-hidden">
|
||||||
<div class="absolute inset-0 overflow-hidden">
|
<div class="absolute inset-0 overflow-hidden">
|
||||||
<section x-on:click.away="$store.flyoutPanel.show = false" class="absolute inset-y-0 right-0 pl-10 max-w-md md:max-w-full flex sm:pl-16">
|
<section x-on:click.away="$store.flyoutPanel.show = false" class="absolute inset-y-0 right-0 pl-10 max-w-md md:max-w-full flex sm:pl-16">
|
||||||
<div class="w-screen max-w-2xl" x-description="Slide-over panel, show/hide based on slide-over state." x-show="$store.flyoutPanel.show == true" x-transition:enter="transform transition ease-in-out duration-500 sm:duration-700" x-transition:enter-start="translate-x-full" x-transition:enter-end="translate-x-0" x-transition:leave="transform transition ease-in-out duration-500 sm:duration-700" x-transition:leave-start="translate-x-0" x-transition:leave-end="translate-x-full">
|
<div class="w-screen max-w-2xl" x-description="Slide-over panel, show/hide based on slide-over state." x-show="$store.flyoutPanel.show == true" x-transition:enter="transform transition ease-in-out duration-500 sm:duration-700" x-transition:enter-start="translate-x-full" x-transition:enter-end="translate-x-0" x-transition:leave="transform transition ease-in-out duration-500 sm:duration-700" x-transition:leave-start="translate-x-0" x-transition:leave-end="translate-x-full">
|
||||||
|
|
@ -15,15 +15,9 @@
|
||||||
</h2>
|
</h2>
|
||||||
}
|
}
|
||||||
<div class="h-7 flex items-center">
|
<div class="h-7 flex items-center">
|
||||||
<button @click="open = false; setTimeout(() => open = true, 1000);"
|
<button x-on:click="$store.flyoutPanel.show = false" aria-label="Close panel" class="text-gray-400 hover:text-gray-500 transition ease-in-out duration-150">
|
||||||
aria-label="Close panel"
|
<svg class="h-6 w-6" x-description="Heroicon name: x" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
class="text-gray-400 hover:text-gray-500 transition ease-in-out duration-150">
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
||||||
<svg class="h-6 w-6" x-description="Heroicon name: x"
|
|
||||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
||||||
stroke="currentColor">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
||||||
d="M6 18L18 6M6 6l12 12">
|
|
||||||
</path>
|
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ namespace ElsaDashboard.Backend.Extensions
|
||||||
{
|
{
|
||||||
public static class ApplicationBuilderExtensions
|
public static class ApplicationBuilderExtensions
|
||||||
{
|
{
|
||||||
public static IApplicationBuilder UserElsaGrpcServices(this IApplicationBuilder app)
|
public static IApplicationBuilder UseElsaGrpcServices(this IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
return app
|
return app
|
||||||
|
.UseCors()
|
||||||
.UseGrpcWeb()
|
.UseGrpcWeb()
|
||||||
.UseEndpoints(endpoints => endpoints
|
.UseEndpoints(endpoints => endpoints
|
||||||
.MapGrpcEndpoint<IActivityService>()
|
.MapGrpcEndpoint<IActivityService>()
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@ using Elsa.Client.Extensions;
|
||||||
using Elsa.Client.Options;
|
using Elsa.Client.Options;
|
||||||
using ElsaDashboard.Backend.Rpc;
|
using ElsaDashboard.Backend.Rpc;
|
||||||
using ElsaDashboard.Shared.Rpc;
|
using ElsaDashboard.Shared.Rpc;
|
||||||
|
using ElsaDashboard.Shared.Surrogates;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using ProtoBuf.Grpc.Server;
|
using ProtoBuf.Grpc.Server;
|
||||||
|
using ProtoBuf.Meta;
|
||||||
|
|
||||||
namespace ElsaDashboard.Backend.Extensions
|
namespace ElsaDashboard.Backend.Extensions
|
||||||
{
|
{
|
||||||
|
|
@ -13,6 +15,8 @@ namespace ElsaDashboard.Backend.Extensions
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddElsaDashboardBackend(this IServiceCollection services, Action<ElsaClientOptions>? configure = default)
|
public static IServiceCollection AddElsaDashboardBackend(this IServiceCollection services, Action<ElsaClientOptions>? configure = default)
|
||||||
{
|
{
|
||||||
|
RuntimeTypeModel.Default.AddElsaGrpcSurrogates();
|
||||||
|
services.AddCors();
|
||||||
services.AddElsaClient(configure);
|
services.AddElsaClient(configure);
|
||||||
services.AddCodeFirstGrpc(options => options.ResponseCompressionLevel = CompressionLevel.Optimal);
|
services.AddCodeFirstGrpc(options => options.ResponseCompressionLevel = CompressionLevel.Optimal);
|
||||||
services.AddScoped<IActivityService, ActivityService>();
|
services.AddScoped<IActivityService, ActivityService>();
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Threading.Tasks;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Elsa.Client;
|
using Elsa.Client;
|
||||||
using Elsa.Client.Models;
|
|
||||||
using ElsaDashboard.Shared.Rpc;
|
using ElsaDashboard.Shared.Rpc;
|
||||||
using ProtoBuf.Grpc;
|
using ProtoBuf.Grpc;
|
||||||
|
|
||||||
|
|
@ -17,10 +14,10 @@ namespace ElsaDashboard.Backend.Rpc
|
||||||
_elsaClient = elsaClient;
|
_elsaClient = elsaClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<ActivityDescriptor>> GetActivitiesAsync(CallContext callContext)
|
public async Task<GetActivitiesResponse> GetActivitiesAsync(CallContext callContext)
|
||||||
{
|
{
|
||||||
var result = await _elsaClient.Activities.ListAsync(callContext.CancellationToken);
|
var result = await _elsaClient.Activities.ListAsync(callContext.CancellationToken);
|
||||||
return result.Items;
|
return new GetActivitiesResponse(result.Items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Google.Api.CommonProtos" Version="2.1.0" />
|
||||||
<PackageReference Include="Grpc.Net.Client" Version="2.33.1" />
|
<PackageReference Include="Grpc.Net.Client" Version="2.33.1" />
|
||||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.33.1" />
|
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.33.1" />
|
||||||
<PackageReference Include="protobuf-net" Version="3.0.52" />
|
<PackageReference Include="protobuf-net" Version="3.0.52" />
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.ServiceModel;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Client.Models;
|
using Elsa.Client.Models;
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
|
|
@ -8,9 +8,25 @@ using ProtoBuf.ServiceModel;
|
||||||
|
|
||||||
namespace ElsaDashboard.Shared.Rpc
|
namespace ElsaDashboard.Shared.Rpc
|
||||||
{
|
{
|
||||||
[ProtoContract]
|
[ServiceContract]
|
||||||
public interface IActivityService
|
public interface IActivityService
|
||||||
{
|
{
|
||||||
[ProtoBehavior]Task<IEnumerable<ActivityDescriptor>> GetActivitiesAsync(CallContext context = default);
|
[ProtoBehavior]
|
||||||
|
Task<GetActivitiesResponse> GetActivitiesAsync(CallContext context = default);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ProtoContract]
|
||||||
|
public sealed class GetActivitiesResponse
|
||||||
|
{
|
||||||
|
public GetActivitiesResponse()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetActivitiesResponse(IEnumerable<ActivityDescriptor> activities)
|
||||||
|
{
|
||||||
|
Activities = activities;
|
||||||
|
}
|
||||||
|
|
||||||
|
[ProtoMember(1)] public IEnumerable<ActivityDescriptor> Activities { get; set; } = new System.Collections.Generic.List<ActivityDescriptor>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using NodaTime;
|
||||||
|
using NodaTime.Serialization.JsonNet;
|
||||||
|
using ProtoBuf;
|
||||||
|
|
||||||
|
namespace ElsaDashboard.Shared.Surrogates
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Surrogate for <see cref="JToken"/>.
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract(IgnoreListHandling = true)]
|
||||||
|
public class JTokenSurrogate
|
||||||
|
{
|
||||||
|
private static readonly JsonSerializerSettings SerializerSettings;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
static JTokenSurrogate()
|
||||||
|
{
|
||||||
|
SerializerSettings = new JsonSerializerSettings().ConfigureForNodaTime(DateTimeZoneProviders.Tzdb);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor overload.
|
||||||
|
/// </summary>
|
||||||
|
public JTokenSurrogate(JToken value) => Value = JsonConvert.SerializeObject(value, SerializerSettings);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stores the Google Protobuf Any value for serialization.
|
||||||
|
/// </summary>
|
||||||
|
public string Value { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the surrogate to a <see cref="JToken"/>.
|
||||||
|
/// </summary>
|
||||||
|
public static implicit operator JToken(JTokenSurrogate surrogate) => JsonConvert.DeserializeObject<JToken>(surrogate.Value, SerializerSettings);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the <see cref="JToken"/> to a surrogate.
|
||||||
|
/// </summary>
|
||||||
|
public static implicit operator JTokenSurrogate(JToken source) => new(source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using ProtoBuf.Meta;
|
||||||
|
|
||||||
|
namespace ElsaDashboard.Shared.Surrogates
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides an extension method to conveniently register surrogate types with the default <see cref="RuntimeTypeModel"/>.
|
||||||
|
/// </summary>
|
||||||
|
public static class RuntimeTypeModelExtensions
|
||||||
|
{
|
||||||
|
private static readonly IDictionary<Type, Type> SurrogateMapping = new Dictionary<Type, Type>
|
||||||
|
{
|
||||||
|
[typeof(JToken)] = typeof(JTokenSurrogate)
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Register all NodaTime surrogate types with the protobuf runtime model.
|
||||||
|
/// </summary>
|
||||||
|
public static RuntimeTypeModel AddElsaGrpcSurrogates(this RuntimeTypeModel runtimeTypeModel)
|
||||||
|
{
|
||||||
|
foreach (var map in SurrogateMapping)
|
||||||
|
runtimeTypeModel.Add(map.Key, false).SetSurrogate(map.Value);
|
||||||
|
|
||||||
|
return runtimeTypeModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using ElsaDashboard.Shared.Rpc;
|
using ElsaDashboard.Shared.Rpc;
|
||||||
|
using ElsaDashboard.Shared.Surrogates;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using ProtoBuf.Meta;
|
||||||
|
|
||||||
namespace ElsaDashboard.WebAssembly.Extensions
|
namespace ElsaDashboard.WebAssembly.Extensions
|
||||||
{
|
{
|
||||||
|
|
@ -7,6 +9,7 @@ namespace ElsaDashboard.WebAssembly.Extensions
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddElsaDashboardBackend(this IServiceCollection services)
|
public static IServiceCollection AddElsaDashboardBackend(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
RuntimeTypeModel.Default.AddElsaGrpcSurrogates();
|
||||||
return services
|
return services
|
||||||
.AddGrpcClient<IActivityService>()
|
.AddGrpcClient<IActivityService>()
|
||||||
.AddGrpcClient<IWorkflowDefinitionService>();
|
.AddGrpcClient<IWorkflowDefinitionService>();
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,10 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Elsa.Metadata;
|
using Elsa.Metadata;
|
||||||
using Elsa.Models;
|
|
||||||
using Elsa.Server.Api.Models;
|
|
||||||
using Elsa.Server.Api.Swagger;
|
|
||||||
using Elsa.Services;
|
using Elsa.Services;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Swashbuckle.AspNetCore.Annotations;
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
using Swashbuckle.AspNetCore.Filters;
|
|
||||||
|
|
||||||
namespace Elsa.Server.Api.Endpoints.Activities
|
namespace Elsa.Server.Api.Endpoints.Activities
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Models;
|
using Elsa.Models;
|
||||||
using Elsa.Server.Api.Models;
|
|
||||||
using Elsa.Server.Api.Swagger;
|
using Elsa.Server.Api.Swagger;
|
||||||
using Elsa.Services;
|
using Elsa.Services;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Elsa.Server.Api.Models
|
namespace Elsa.Server.Api.Models
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Core.IntegrationTests.Helpers;
|
using Elsa.Core.IntegrationTests.Helpers;
|
||||||
using Elsa.Models;
|
using Elsa.Models;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Storage.Net.Blobs;
|
using Storage.Net.Blobs;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Models;
|
using Elsa.Models;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AutoFixture;
|
using AutoFixture;
|
||||||
using Elsa.Models;
|
using Elsa.Models;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Models;
|
using Elsa.Models;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ using Elsa.Activities.Signaling;
|
||||||
using Elsa.Activities.Signaling.Models;
|
using Elsa.Activities.Signaling.Models;
|
||||||
using Elsa.Models;
|
using Elsa.Models;
|
||||||
using Elsa.Services.Models;
|
using Elsa.Services.Models;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Models;
|
using Elsa.Models;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Elsa.Testing.Shared.Helpers;
|
|
||||||
using Elsa.Testing.Shared.Unit;
|
using Elsa.Testing.Shared.Unit;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using Xunit.Abstractions;
|
using Xunit.Abstractions;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue