2022-05-26 10:47:31 +00:00
|
|
|
using Elsa.Workflows.Api.Middleware;
|
2022-01-04 08:42:12 +00:00
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
|
|
2022-12-31 15:16:43 +00:00
|
|
|
// ReSharper disable once CheckNamespace
|
|
|
|
|
namespace Elsa.Extensions;
|
2022-01-04 08:42:12 +00:00
|
|
|
|
2023-06-29 20:08:10 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Provides extensions to <see cref="IApplicationBuilder"/>.
|
|
|
|
|
/// </summary>
|
2022-01-04 08:42:12 +00:00
|
|
|
public static class ApplicationBuilderExtensions
|
|
|
|
|
{
|
2023-06-29 20:08:10 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Adds middleware that handles JSON serialization errors.
|
|
|
|
|
/// </summary>
|
2022-01-04 08:42:12 +00:00
|
|
|
public static IApplicationBuilder UseJsonSerializationErrorHandler(this IApplicationBuilder app) => app.UseMiddleware<JsonSerializationErrorHandlerMiddleware>();
|
|
|
|
|
}
|