diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 11824e3ac..469db5856 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -179,6 +179,7 @@ export default { {text: 'Using as Mediator', link: '/guide/http/mediator'}, {text: 'Multi-Tenancy and ASP.Net Core', link: '/guide/http/multi-tenancy'}, {text: 'Publishing Messages', link: '/guide/http/messaging'}, + {text: 'Uploading Files', link: '/guide/http/files'}, {text: 'Integration with Sagas', link: '/guide/http/sagas'}, {text: 'Integration with Marten', link: '/guide/http/marten'}, {text: 'Fluent Validation', link: '/guide/http/fluentvalidation'}, diff --git a/docs/guide/http/files.md b/docs/guide/http/files.md new file mode 100644 index 000000000..af5be24e8 --- /dev/null +++ b/docs/guide/http/files.md @@ -0,0 +1,9 @@ +# Uploading Files + +As of 1.11.0, Wolverine supports file uploads through the standard ASP.Net Core `IFile` or `IFileCollection` types. All you need +to do to is to have an input parameter to your Wolverine.HTTP endpoint of these types like so: + +snippet: sample_using_file_uploads + +See [Upload files in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-7.0) +for more information about these types. \ No newline at end of file diff --git a/src/Http/WolverineWebApi/FileUploadEndpoint.cs b/src/Http/WolverineWebApi/FileUploadEndpoint.cs new file mode 100644 index 000000000..e890fe004 --- /dev/null +++ b/src/Http/WolverineWebApi/FileUploadEndpoint.cs @@ -0,0 +1,28 @@ +using Wolverine.Http; + +namespace WolverineWebApi; + +#region sample_using_file_uploads + +public class FileUploadEndpoint +{ + // If you have exactly one file upload, take + // in IFormFile + [WolverinePost("/upload/file")] + public static Task Upload(IFormFile file) + { + // access the file data + return Task.CompletedTask; + } + + // If you have multiple files at one time, + // use IFormCollection + [WolverinePost("/upload/files")] + public static Task Upload(IFormFileCollection files) + { + // access files + return Task.CompletedTask; + } +} + +#endregion \ No newline at end of file diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_data_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_data_id.cs index 03be4a700..6933055a9 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_data_id.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_data_id.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class GET_data_id : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public GET_data_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public GET_data_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_id.cs index 8e1d3e35f..b49e120c5 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_id.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_id.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class GET_invoices_id : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public GET_invoices_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public GET_invoices_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_longhand_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_longhand_id.cs index 9b6b6a232..23b457ba7 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_longhand_id.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_longhand_id.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class GET_invoices_longhand_id : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public GET_invoices_longhand_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public GET_invoices_longhand_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_swagger_users_userId.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_swagger_users_userId.cs index 85d2c5cb3..4ad2a3ac2 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_swagger_users_userId.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_swagger_users_userId.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class GET_swagger_users_userId : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public GET_swagger_users_userId(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public GET_swagger_users_userId(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_timed.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_timed.cs index 4ac4277f6..083914b5c 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_timed.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_timed.cs @@ -24,8 +24,8 @@ public GET_timed(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Micro public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) { - var stopwatchMiddleware = new WolverineWebApi.StopwatchMiddleware(); var measuredEndpoint = new WolverineWebApi.MeasuredEndpoint(); + var stopwatchMiddleware = new WolverineWebApi.StopwatchMiddleware(); stopwatchMiddleware.Before(); // The actual HTTP request handler execution diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_write_to_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_write_to_id.cs index 01df1d3c7..e6e8872ec 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_write_to_id.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_write_to_id.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class GET_write_to_id : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public GET_write_to_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public GET_write_to_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_create.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_create.cs index 6876d8b33..49df4dcc0 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_create.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_create.cs @@ -28,8 +28,8 @@ public POST_ef_create(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) { var efCoreEndpoints = new WolverineWebApi.EfCoreEndpoints(); - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); await using var itemsDbContext = new WolverineWebApi.ItemsDbContext(_dbContextOptions); + var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); // Enroll the DbContext & IMessagingContext in the outgoing Wolverine outbox transaction var envelopeTransaction = Wolverine.EntityFrameworkCore.WolverineEntityCoreExtensions.BuildTransaction(itemsDbContext, messageContext); diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_invoiceId_pay.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_invoiceId_pay.cs index 391593ec4..5b75935d4 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_invoiceId_pay.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_invoiceId_pay.cs @@ -13,20 +13,23 @@ namespace Internal.Generated.WolverineHandlers public class POST_invoices_invoiceId_pay : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_invoices_invoiceId_pay(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_invoices_invoiceId_pay(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) { + var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); + // Building the Marten session + await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); if (!System.Guid.TryParse((string)httpContext.GetRouteValue("invoiceId"), out var invoiceId)) { httpContext.Response.StatusCode = 404; @@ -34,9 +37,6 @@ public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Ht } - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); var invoice = await documentSession.LoadAsync(invoiceId, httpContext.RequestAborted).ConfigureAwait(false); // The actual HTTP request handler execution diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_number_approve.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_number_approve.cs index d8173ca39..13f3354d2 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_number_approve.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_number_approve.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_invoices_number_approve : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_invoices_number_approve(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_invoices_number_approve(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_issue.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_issue.cs index bb77f1f86..7189b6385 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_issue.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_issue.cs @@ -13,24 +13,24 @@ namespace Internal.Generated.WolverineHandlers public class POST_issue : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_issue(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_issue(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) { + var createEndpoint = new WolverineWebApi.CreateEndpoint(); var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); // Building the Marten session await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - var createEndpoint = new WolverineWebApi.CreateEndpoint(); // Reading the request body via JSON deserialization var (command, jsonContinue) = await ReadJsonAsync(httpContext); if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create.cs index 5596555a8..f725513e4 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_create : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_create(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_create(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create2.cs index 11915b832..4e61655d1 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create2.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create2.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_create2 : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_create2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_create2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create3.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create3.cs index eed22f4c8..c972e315a 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create3.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create3.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_create3 : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_create3(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_create3(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create4.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create4.cs index a8211aaf3..ff7fa6a6e 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create4.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create4.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_create4 : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_create4(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_create4(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_itemready.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_itemready.cs index fa79d0b2c..f483f8640 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_itemready.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_itemready.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_itemready : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_itemready(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_itemready(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship2.cs index 1089d9d72..a260d885c 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship2.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship2.cs @@ -13,21 +13,20 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_orderId_ship2 : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_orderId_ship2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_orderId_ship2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) { - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); if (!System.Guid.TryParse((string)httpContext.GetRouteValue("orderId"), out var orderId)) { httpContext.Response.StatusCode = 404; @@ -35,6 +34,7 @@ public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Ht } + var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); // Reading the request body via JSON deserialization var (command, jsonContinue) = await ReadJsonAsync(httpContext); if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship3.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship3.cs index ee30405fc..570c2599d 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship3.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship3.cs @@ -13,21 +13,20 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_orderId_ship3 : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_orderId_ship3(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_orderId_ship3(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) { - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); if (!System.Guid.TryParse((string)httpContext.GetRouteValue("orderId"), out var orderId)) { httpContext.Response.StatusCode = 404; @@ -35,6 +34,7 @@ public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Ht } + var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); var eventStore = documentSession.Events; diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship4.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship4.cs index fc718ef29..58d197f54 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship4.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship4.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_orderId_ship4 : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_orderId_ship4(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_orderId_ship4(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_ship.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_ship.cs index 6c8361dd8..866e73d5a 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_ship.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_ship.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_orders_ship : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_orders_ship(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_orders_ship(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_marten_message.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_marten_message.cs index e34c31837..e760880f7 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_marten_message.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_marten_message.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_publish_marten_message : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_publish_marten_message(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_publish_marten_message(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation.cs index 22ff1cbbd..b05c512f7 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_reservation : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_reservation(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_reservation(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation2.cs index c0f612daf..6c7f2e2e5 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation2.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation2.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_reservation2 : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_reservation2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_reservation2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_some_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_some_id.cs index ef85a159c..10d6bc4c2 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_some_id.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_some_id.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_some_id : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_some_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_some_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_swagger_empty.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_swagger_empty.cs index 26b911111..c5d593201 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_swagger_empty.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_swagger_empty.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_swagger_empty : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_swagger_empty(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_swagger_empty(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_todoitems.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_todoitems.cs index 332f30ef9..2974d2aa9 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_todoitems.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_todoitems.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_todoitems : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public POST_todoitems(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public POST_todoitems(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_upload_file.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_upload_file.cs new file mode 100644 index 000000000..548b455bf --- /dev/null +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_upload_file.cs @@ -0,0 +1,40 @@ +// +#pragma warning disable +using Microsoft.AspNetCore.Routing; +using System; +using System.Linq; +using Wolverine.Http; + +namespace Internal.Generated.WolverineHandlers +{ + // START: POST_upload_file + public class POST_upload_file : Wolverine.Http.HttpHandler + { + private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; + + public POST_upload_file(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) + { + _wolverineHttpOptions = wolverineHttpOptions; + } + + + + public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) + { + // Retrieve header value from the request + var file = ReadSingleFormFileValue(httpContext); + + // The actual HTTP request handler execution + await WolverineWebApi.FileUploadEndpoint.Upload(file).ConfigureAwait(false); + + // Wolverine automatically sets the status code to 204 for empty responses + if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; + } + + } + + // END: POST_upload_file + + +} + diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_upload_files.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_upload_files.cs new file mode 100644 index 000000000..93aac2af1 --- /dev/null +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_upload_files.cs @@ -0,0 +1,40 @@ +// +#pragma warning disable +using Microsoft.AspNetCore.Routing; +using System; +using System.Linq; +using Wolverine.Http; + +namespace Internal.Generated.WolverineHandlers +{ + // START: POST_upload_files + public class POST_upload_files : Wolverine.Http.HttpHandler + { + private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; + + public POST_upload_files(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) + { + _wolverineHttpOptions = wolverineHttpOptions; + } + + + + public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) + { + // Retrieve header value from the request + var files = ReadManyFormFileValues(httpContext); + + // The actual HTTP request handler execution + await WolverineWebApi.FileUploadEndpoint.Upload(files).ConfigureAwait(false); + + // Wolverine automatically sets the status code to 204 for empty responses + if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; + } + + } + + // END: POST_upload_files + + +} + diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_customer.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_customer.cs index 6160d4611..bbc6479b0 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_customer.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_customer.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_validate2_customer : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly FluentValidation.IValidator _validator; private readonly Wolverine.Http.FluentValidation.IProblemDetailSource _problemDetailSource; + private readonly FluentValidation.IValidator _validator; - public POST_validate2_customer(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, FluentValidation.IValidator validator, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource) : base(wolverineHttpOptions) + public POST_validate2_customer(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource, FluentValidation.IValidator validator) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _validator = validator; _problemDetailSource = problemDetailSource; + _validator = validator; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_user.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_user.cs index 3a2180555..c3e4e5c13 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_user.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_user.cs @@ -13,23 +13,23 @@ namespace Internal.Generated.WolverineHandlers public class POST_validate2_user : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly FluentValidation.IValidator _validator_of_CreateUser2_348930900; - private readonly FluentValidation.IValidator _validator_of_CreateUser2_1683673752; + private readonly FluentValidation.IValidator _validator_of_CreateUser2_145622491; private readonly Wolverine.Http.FluentValidation.IProblemDetailSource _problemDetailSource; + private readonly FluentValidation.IValidator _validator_of_CreateUser21595005926; - public POST_validate2_user(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, [Lamar.Named("createUserValidator")] FluentValidation.IValidator validator_of_CreateUser2_348930900, [Lamar.Named("passwordValidator")] FluentValidation.IValidator validator_of_CreateUser2_1683673752, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource) : base(wolverineHttpOptions) + public POST_validate2_user(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, [Lamar.Named("passwordValidator")] FluentValidation.IValidator validator_of_CreateUser2_145622491, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource, [Lamar.Named("createUserValidator")] FluentValidation.IValidator validator_of_CreateUser21595005926) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _validator_of_CreateUser2_348930900 = validator_of_CreateUser2_348930900; - _validator_of_CreateUser2_1683673752 = validator_of_CreateUser2_1683673752; + _validator_of_CreateUser2_145622491 = validator_of_CreateUser2_145622491; _problemDetailSource = problemDetailSource; + _validator_of_CreateUser21595005926 = validator_of_CreateUser21595005926; } public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) { - var validatorList = new System.Collections.Generic.List>{_validator_of_CreateUser2_348930900, _validator_of_CreateUser2_1683673752}; + var validatorList = new System.Collections.Generic.List>{_validator_of_CreateUser21595005926, _validator_of_CreateUser2_145622491}; // Reading the request body via JSON deserialization var (user, jsonContinue) = await ReadJsonAsync(httpContext); if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_customer.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_customer.cs index 8b611eb38..52e75a8e7 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_customer.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_customer.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class POST_validate_customer : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly FluentValidation.IValidator _validator; private readonly Wolverine.Http.FluentValidation.IProblemDetailSource _problemDetailSource; + private readonly FluentValidation.IValidator _validator; - public POST_validate_customer(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, FluentValidation.IValidator validator, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource) : base(wolverineHttpOptions) + public POST_validate_customer(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource, FluentValidation.IValidator validator) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _validator = validator; _problemDetailSource = problemDetailSource; + _validator = validator; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_user.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_user.cs index 5b2d78850..476bb0950 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_user.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_user.cs @@ -13,23 +13,23 @@ namespace Internal.Generated.WolverineHandlers public class POST_validate_user : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly FluentValidation.IValidator _validator_of_CreateUser1376587052; + private readonly FluentValidation.IValidator _validator_of_CreateUser1056561761; private readonly Wolverine.Http.FluentValidation.IProblemDetailSource _problemDetailSource; - private readonly FluentValidation.IValidator _validator_of_CreateUser580623592; + private readonly FluentValidation.IValidator _validator_of_CreateUser_1766196318; - public POST_validate_user(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, [Lamar.Named("passwordValidator")] FluentValidation.IValidator validator_of_CreateUser1376587052, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource, [Lamar.Named("createUserValidator")] FluentValidation.IValidator validator_of_CreateUser580623592) : base(wolverineHttpOptions) + public POST_validate_user(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, [Lamar.Named("passwordValidator")] FluentValidation.IValidator validator_of_CreateUser1056561761, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource, [Lamar.Named("createUserValidator")] FluentValidation.IValidator validator_of_CreateUser_1766196318) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _validator_of_CreateUser1376587052 = validator_of_CreateUser1376587052; + _validator_of_CreateUser1056561761 = validator_of_CreateUser1056561761; _problemDetailSource = problemDetailSource; - _validator_of_CreateUser580623592 = validator_of_CreateUser580623592; + _validator_of_CreateUser_1766196318 = validator_of_CreateUser_1766196318; } public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) { - var validatorList = new System.Collections.Generic.List>{_validator_of_CreateUser580623592, _validator_of_CreateUser1376587052}; + var validatorList = new System.Collections.Generic.List>{_validator_of_CreateUser_1766196318, _validator_of_CreateUser1056561761}; // Reading the request body via JSON deserialization var (user, jsonContinue) = await ReadJsonAsync(httpContext); if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos2_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos2_id.cs index e661a2c52..d1b957754 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos2_id.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos2_id.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class PUT_todos2_id : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public PUT_todos2_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public PUT_todos2_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; } diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos_id.cs index 2cfe3ace7..8bdb92a2a 100644 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos_id.cs +++ b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos_id.cs @@ -13,14 +13,14 @@ namespace Internal.Generated.WolverineHandlers public class PUT_todos_id : Wolverine.Http.HttpHandler { private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; + private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - public PUT_todos_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) + public PUT_todos_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) { _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; _outboxedSessionFactory = outboxedSessionFactory; + _wolverineRuntime = wolverineRuntime; }