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/Wolverine.Http/CodeGen/FromFileStrategy.cs b/src/Http/Wolverine.Http/CodeGen/FromFileStrategy.cs new file mode 100644 index 000000000..7cc13cb11 --- /dev/null +++ b/src/Http/Wolverine.Http/CodeGen/FromFileStrategy.cs @@ -0,0 +1,80 @@ +using System.Reflection; +using JasperFx.CodeGeneration; +using JasperFx.CodeGeneration.Frames; +using JasperFx.CodeGeneration.Model; +using Lamar; +using Microsoft.AspNetCore.Http; + +namespace Wolverine.Http.CodeGen; + +public class FromFileStrategy : IParameterStrategy +{ + public bool TryMatch(HttpChain chain, IContainer container, ParameterInfo parameter, out Variable? variable) + { + if (parameter.ParameterType == typeof(IFormFile)) + { + var frame = new FromFileValue(parameter); + chain.Middleware.Add(frame); + variable = frame.Variable; + return true; + } else if (parameter.ParameterType == typeof(IFormFileCollection)) + { + var frame = new FromFileValues(parameter); + chain.Middleware.Add(frame); + variable = frame.Variable; + return true; + } + variable = null; + return false; + } +} + +internal class FromFileValue : SyncFrame +{ + private Variable? _httpContext; + public FromFileValue(ParameterInfo parameter) + { + Variable = new Variable(parameter.ParameterType, parameter.Name!, this); + } + + public Variable Variable { get; } + + public override IEnumerable FindVariables(IMethodVariables chain) + { + _httpContext = chain.FindVariable(typeof(HttpContext)); + yield return _httpContext; + } + + public override void GenerateCode(GeneratedMethod method, ISourceWriter writer) + { + writer.WriteComment("Retrieve header value from the request"); + writer.Write( + $"var {Variable.Usage} = {nameof(HttpHandler.ReadSingleFormFileValue)}({_httpContext!.Usage});"); + Next?.GenerateCode(method, writer); + } +} + +internal class FromFileValues : SyncFrame +{ + private Variable? _httpContext; + public FromFileValues(ParameterInfo parameter) + { + Variable = new Variable(parameter.ParameterType, parameter.Name!, this); + } + + public Variable Variable { get; } + + public override IEnumerable FindVariables(IMethodVariables chain) + { + _httpContext = chain.FindVariable(typeof(HttpContext)); + yield return _httpContext; + } + + public override void GenerateCode(GeneratedMethod method, ISourceWriter writer) + { + writer.WriteComment("Retrieve header value from the request"); + writer.Write( + $"var {Variable.Usage} = {nameof(HttpHandler.ReadManyFormFileValues)}({_httpContext!.Usage});"); + Next?.GenerateCode(method, writer); + } +} \ No newline at end of file diff --git a/src/Http/Wolverine.Http/HttpGraph.ParameterMatching.cs b/src/Http/Wolverine.Http/HttpGraph.ParameterMatching.cs index 3880b939d..c2c634f42 100644 --- a/src/Http/Wolverine.Http/HttpGraph.ParameterMatching.cs +++ b/src/Http/Wolverine.Http/HttpGraph.ParameterMatching.cs @@ -7,6 +7,10 @@ public partial class HttpGraph { private readonly List _strategies = new() { +<<<<<<< HEAD +======= + new FromFileStrategy(), +>>>>>>> alistair-file_upload_support new HttpChainParameterAttributeStrategy(), new FromServicesParameterStrategy(), new MessageBusStrategy(), diff --git a/src/Http/Wolverine.Http/HttpHandler.cs b/src/Http/Wolverine.Http/HttpHandler.cs index 40477c16c..e74fd3d37 100644 --- a/src/Http/Wolverine.Http/HttpHandler.cs +++ b/src/Http/Wolverine.Http/HttpHandler.cs @@ -57,6 +57,16 @@ public static string[] ReadManyHeaderValues(HttpContext context, string headerKe return context.Request.Headers[headerKey].ToArray()!; } + public static IFormFile? ReadSingleFormFileValue(HttpContext context) + { + return context.Request.Form.Files.SingleOrDefault(); + } + + public static IFormFileCollection? ReadManyFormFileValues(HttpContext context) + { + return context.Request.Form.Files; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task WriteString(HttpContext context, string text) { 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/DocumentStorage/DeadLetterEventProvider834684974.cs b/src/Http/WolverineWebApi/Internal/Generated/DocumentStorage/DeadLetterEventProvider834684974.cs deleted file mode 100644 index 8b23b9ef6..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/DocumentStorage/DeadLetterEventProvider834684974.cs +++ /dev/null @@ -1,848 +0,0 @@ -// -#pragma warning disable -using Marten.Events.Daemon; -using Marten.Internal; -using Marten.Internal.Storage; -using Marten.Schema; -using Marten.Schema.Arguments; -using Npgsql; -using System; -using System.Collections.Generic; -using Weasel.Core; -using Weasel.Postgresql; - -namespace Marten.Generated.DocumentStorage -{ - // START: UpsertDeadLetterEventOperation834684974 - public class UpsertDeadLetterEventOperation834684974 : Marten.Internal.Operations.StorageOperation - { - private readonly Marten.Events.Daemon.DeadLetterEvent _document; - private readonly System.Guid _id; - private readonly System.Collections.Generic.Dictionary _versions; - private readonly Marten.Schema.DocumentMapping _mapping; - - public UpsertDeadLetterEventOperation834684974(Marten.Events.Daemon.DeadLetterEvent document, System.Guid id, System.Collections.Generic.Dictionary versions, Marten.Schema.DocumentMapping mapping) : base(document, id, versions, mapping) - { - _document = document; - _id = id; - _versions = versions; - _mapping = mapping; - } - - - public const string COMMAND_TEXT = "select http.mt_upsert_deadletterevent(?, ?, ?, ?)"; - - - public override void Postprocess(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions) - { - storeVersion(); - } - - - public override System.Threading.Tasks.Task PostprocessAsync(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions, System.Threading.CancellationToken token) - { - storeVersion(); - // Nothing - return System.Threading.Tasks.Task.CompletedTask; - } - - - public override Marten.Internal.Operations.OperationRole Role() - { - return Marten.Internal.Operations.OperationRole.Upsert; - } - - - public override string CommandText() - { - return COMMAND_TEXT; - } - - - public override NpgsqlTypes.NpgsqlDbType DbType() - { - return NpgsqlTypes.NpgsqlDbType.Uuid; - } - - - public override void ConfigureParameters(Npgsql.NpgsqlParameter[] parameters, Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session) - { - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Jsonb; - parameters[0].Value = session.Serializer.ToJson(_document); - // .Net Class Type - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Varchar; - parameters[1].Value = _document.GetType().FullName; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[2].Value = document.Id; - setVersionParameter(parameters[3]); - } - - } - - // END: UpsertDeadLetterEventOperation834684974 - - - // START: InsertDeadLetterEventOperation834684974 - public class InsertDeadLetterEventOperation834684974 : Marten.Internal.Operations.StorageOperation - { - private readonly Marten.Events.Daemon.DeadLetterEvent _document; - private readonly System.Guid _id; - private readonly System.Collections.Generic.Dictionary _versions; - private readonly Marten.Schema.DocumentMapping _mapping; - - public InsertDeadLetterEventOperation834684974(Marten.Events.Daemon.DeadLetterEvent document, System.Guid id, System.Collections.Generic.Dictionary versions, Marten.Schema.DocumentMapping mapping) : base(document, id, versions, mapping) - { - _document = document; - _id = id; - _versions = versions; - _mapping = mapping; - } - - - public const string COMMAND_TEXT = "select http.mt_insert_deadletterevent(?, ?, ?, ?)"; - - - public override void Postprocess(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions) - { - storeVersion(); - } - - - public override System.Threading.Tasks.Task PostprocessAsync(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions, System.Threading.CancellationToken token) - { - storeVersion(); - // Nothing - return System.Threading.Tasks.Task.CompletedTask; - } - - - public override Marten.Internal.Operations.OperationRole Role() - { - return Marten.Internal.Operations.OperationRole.Insert; - } - - - public override string CommandText() - { - return COMMAND_TEXT; - } - - - public override NpgsqlTypes.NpgsqlDbType DbType() - { - return NpgsqlTypes.NpgsqlDbType.Uuid; - } - - - public override void ConfigureParameters(Npgsql.NpgsqlParameter[] parameters, Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session) - { - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Jsonb; - parameters[0].Value = session.Serializer.ToJson(_document); - // .Net Class Type - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Varchar; - parameters[1].Value = _document.GetType().FullName; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[2].Value = document.Id; - setVersionParameter(parameters[3]); - } - - } - - // END: InsertDeadLetterEventOperation834684974 - - - // START: UpdateDeadLetterEventOperation834684974 - public class UpdateDeadLetterEventOperation834684974 : Marten.Internal.Operations.StorageOperation - { - private readonly Marten.Events.Daemon.DeadLetterEvent _document; - private readonly System.Guid _id; - private readonly System.Collections.Generic.Dictionary _versions; - private readonly Marten.Schema.DocumentMapping _mapping; - - public UpdateDeadLetterEventOperation834684974(Marten.Events.Daemon.DeadLetterEvent document, System.Guid id, System.Collections.Generic.Dictionary versions, Marten.Schema.DocumentMapping mapping) : base(document, id, versions, mapping) - { - _document = document; - _id = id; - _versions = versions; - _mapping = mapping; - } - - - public const string COMMAND_TEXT = "select http.mt_update_deadletterevent(?, ?, ?, ?)"; - - - public override void Postprocess(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions) - { - storeVersion(); - postprocessUpdate(reader, exceptions); - } - - - public override async System.Threading.Tasks.Task PostprocessAsync(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions, System.Threading.CancellationToken token) - { - storeVersion(); - await postprocessUpdateAsync(reader, exceptions, token); - } - - - public override Marten.Internal.Operations.OperationRole Role() - { - return Marten.Internal.Operations.OperationRole.Update; - } - - - public override string CommandText() - { - return COMMAND_TEXT; - } - - - public override NpgsqlTypes.NpgsqlDbType DbType() - { - return NpgsqlTypes.NpgsqlDbType.Uuid; - } - - - public override void ConfigureParameters(Npgsql.NpgsqlParameter[] parameters, Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session) - { - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Jsonb; - parameters[0].Value = session.Serializer.ToJson(_document); - // .Net Class Type - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Varchar; - parameters[1].Value = _document.GetType().FullName; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[2].Value = document.Id; - setVersionParameter(parameters[3]); - } - - } - - // END: UpdateDeadLetterEventOperation834684974 - - - // START: QueryOnlyDeadLetterEventSelector834684974 - public class QueryOnlyDeadLetterEventSelector834684974 : Marten.Internal.CodeGeneration.DocumentSelectorWithOnlySerializer, Marten.Linq.Selectors.ISelector - { - private readonly Marten.Internal.IMartenSession _session; - private readonly Marten.Schema.DocumentMapping _mapping; - - public QueryOnlyDeadLetterEventSelector834684974(Marten.Internal.IMartenSession session, Marten.Schema.DocumentMapping mapping) : base(session, mapping) - { - _session = session; - _mapping = mapping; - } - - - - public Marten.Events.Daemon.DeadLetterEvent Resolve(System.Data.Common.DbDataReader reader) - { - - Marten.Events.Daemon.DeadLetterEvent document; - document = _serializer.FromJson(reader, 0); - return document; - } - - - public async System.Threading.Tasks.Task ResolveAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - - Marten.Events.Daemon.DeadLetterEvent document; - document = await _serializer.FromJsonAsync(reader, 0, token).ConfigureAwait(false); - return document; - } - - } - - // END: QueryOnlyDeadLetterEventSelector834684974 - - - // START: LightweightDeadLetterEventSelector834684974 - public class LightweightDeadLetterEventSelector834684974 : Marten.Internal.CodeGeneration.DocumentSelectorWithVersions, Marten.Linq.Selectors.ISelector - { - private readonly Marten.Internal.IMartenSession _session; - private readonly Marten.Schema.DocumentMapping _mapping; - - public LightweightDeadLetterEventSelector834684974(Marten.Internal.IMartenSession session, Marten.Schema.DocumentMapping mapping) : base(session, mapping) - { - _session = session; - _mapping = mapping; - } - - - - public Marten.Events.Daemon.DeadLetterEvent Resolve(System.Data.Common.DbDataReader reader) - { - var id = reader.GetFieldValue(0); - - Marten.Events.Daemon.DeadLetterEvent document; - document = _serializer.FromJson(reader, 1); - _session.MarkAsDocumentLoaded(id, document); - return document; - } - - - public async System.Threading.Tasks.Task ResolveAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - var id = await reader.GetFieldValueAsync(0, token); - - Marten.Events.Daemon.DeadLetterEvent document; - document = await _serializer.FromJsonAsync(reader, 1, token).ConfigureAwait(false); - _session.MarkAsDocumentLoaded(id, document); - return document; - } - - } - - // END: LightweightDeadLetterEventSelector834684974 - - - // START: IdentityMapDeadLetterEventSelector834684974 - public class IdentityMapDeadLetterEventSelector834684974 : Marten.Internal.CodeGeneration.DocumentSelectorWithIdentityMap, Marten.Linq.Selectors.ISelector - { - private readonly Marten.Internal.IMartenSession _session; - private readonly Marten.Schema.DocumentMapping _mapping; - - public IdentityMapDeadLetterEventSelector834684974(Marten.Internal.IMartenSession session, Marten.Schema.DocumentMapping mapping) : base(session, mapping) - { - _session = session; - _mapping = mapping; - } - - - - public Marten.Events.Daemon.DeadLetterEvent Resolve(System.Data.Common.DbDataReader reader) - { - var id = reader.GetFieldValue(0); - if (_identityMap.TryGetValue(id, out var existing)) return existing; - - Marten.Events.Daemon.DeadLetterEvent document; - document = _serializer.FromJson(reader, 1); - _session.MarkAsDocumentLoaded(id, document); - _identityMap[id] = document; - return document; - } - - - public async System.Threading.Tasks.Task ResolveAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - var id = await reader.GetFieldValueAsync(0, token); - if (_identityMap.TryGetValue(id, out var existing)) return existing; - - Marten.Events.Daemon.DeadLetterEvent document; - document = await _serializer.FromJsonAsync(reader, 1, token).ConfigureAwait(false); - _session.MarkAsDocumentLoaded(id, document); - _identityMap[id] = document; - return document; - } - - } - - // END: IdentityMapDeadLetterEventSelector834684974 - - - // START: DirtyTrackingDeadLetterEventSelector834684974 - public class DirtyTrackingDeadLetterEventSelector834684974 : Marten.Internal.CodeGeneration.DocumentSelectorWithDirtyChecking, Marten.Linq.Selectors.ISelector - { - private readonly Marten.Internal.IMartenSession _session; - private readonly Marten.Schema.DocumentMapping _mapping; - - public DirtyTrackingDeadLetterEventSelector834684974(Marten.Internal.IMartenSession session, Marten.Schema.DocumentMapping mapping) : base(session, mapping) - { - _session = session; - _mapping = mapping; - } - - - - public Marten.Events.Daemon.DeadLetterEvent Resolve(System.Data.Common.DbDataReader reader) - { - var id = reader.GetFieldValue(0); - if (_identityMap.TryGetValue(id, out var existing)) return existing; - - Marten.Events.Daemon.DeadLetterEvent document; - document = _serializer.FromJson(reader, 1); - _session.MarkAsDocumentLoaded(id, document); - _identityMap[id] = document; - StoreTracker(_session, document); - return document; - } - - - public async System.Threading.Tasks.Task ResolveAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - var id = await reader.GetFieldValueAsync(0, token); - if (_identityMap.TryGetValue(id, out var existing)) return existing; - - Marten.Events.Daemon.DeadLetterEvent document; - document = await _serializer.FromJsonAsync(reader, 1, token).ConfigureAwait(false); - _session.MarkAsDocumentLoaded(id, document); - _identityMap[id] = document; - StoreTracker(_session, document); - return document; - } - - } - - // END: DirtyTrackingDeadLetterEventSelector834684974 - - - // START: QueryOnlyDeadLetterEventDocumentStorage834684974 - public class QueryOnlyDeadLetterEventDocumentStorage834684974 : Marten.Internal.Storage.QueryOnlyDocumentStorage - { - private readonly Marten.Schema.DocumentMapping _document; - - public QueryOnlyDeadLetterEventDocumentStorage834684974(Marten.Schema.DocumentMapping document) : base(document) - { - _document = document; - } - - - - public override System.Guid AssignIdentity(Marten.Events.Daemon.DeadLetterEvent document, string tenantId, Marten.Storage.IMartenDatabase database) - { - if (document.Id == Guid.Empty) _setter(document, Marten.Schema.Identity.CombGuidIdGeneration.NewGuid()); - return document.Id; - } - - - public override Marten.Internal.Operations.IStorageOperation Update(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpdateDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Insert(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.InsertDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Upsert(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpsertDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Overwrite(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - throw new System.NotSupportedException(); - } - - - public override System.Guid Identity(Marten.Events.Daemon.DeadLetterEvent document) - { - return document.Id; - } - - - public override Marten.Linq.Selectors.ISelector BuildSelector(Marten.Internal.IMartenSession session) - { - return new Marten.Generated.DocumentStorage.QueryOnlyDeadLetterEventSelector834684974(session, _document); - } - - - public override Npgsql.NpgsqlCommand BuildLoadCommand(System.Guid id, string tenant) - { - return new NpgsqlCommand(_loaderSql).With("id", id); - } - - - public override Npgsql.NpgsqlCommand BuildLoadManyCommand(System.Guid[] ids, string tenant) - { - return new NpgsqlCommand(_loadArraySql).With("ids", ids); - } - - } - - // END: QueryOnlyDeadLetterEventDocumentStorage834684974 - - - // START: LightweightDeadLetterEventDocumentStorage834684974 - public class LightweightDeadLetterEventDocumentStorage834684974 : Marten.Internal.Storage.LightweightDocumentStorage - { - private readonly Marten.Schema.DocumentMapping _document; - - public LightweightDeadLetterEventDocumentStorage834684974(Marten.Schema.DocumentMapping document) : base(document) - { - _document = document; - } - - - - public override System.Guid AssignIdentity(Marten.Events.Daemon.DeadLetterEvent document, string tenantId, Marten.Storage.IMartenDatabase database) - { - if (document.Id == Guid.Empty) _setter(document, Marten.Schema.Identity.CombGuidIdGeneration.NewGuid()); - return document.Id; - } - - - public override Marten.Internal.Operations.IStorageOperation Update(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpdateDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Insert(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.InsertDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Upsert(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpsertDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Overwrite(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - throw new System.NotSupportedException(); - } - - - public override System.Guid Identity(Marten.Events.Daemon.DeadLetterEvent document) - { - return document.Id; - } - - - public override Marten.Linq.Selectors.ISelector BuildSelector(Marten.Internal.IMartenSession session) - { - return new Marten.Generated.DocumentStorage.LightweightDeadLetterEventSelector834684974(session, _document); - } - - - public override Npgsql.NpgsqlCommand BuildLoadCommand(System.Guid id, string tenant) - { - return new NpgsqlCommand(_loaderSql).With("id", id); - } - - - public override Npgsql.NpgsqlCommand BuildLoadManyCommand(System.Guid[] ids, string tenant) - { - return new NpgsqlCommand(_loadArraySql).With("ids", ids); - } - - } - - // END: LightweightDeadLetterEventDocumentStorage834684974 - - - // START: IdentityMapDeadLetterEventDocumentStorage834684974 - public class IdentityMapDeadLetterEventDocumentStorage834684974 : Marten.Internal.Storage.IdentityMapDocumentStorage - { - private readonly Marten.Schema.DocumentMapping _document; - - public IdentityMapDeadLetterEventDocumentStorage834684974(Marten.Schema.DocumentMapping document) : base(document) - { - _document = document; - } - - - - public override System.Guid AssignIdentity(Marten.Events.Daemon.DeadLetterEvent document, string tenantId, Marten.Storage.IMartenDatabase database) - { - if (document.Id == Guid.Empty) _setter(document, Marten.Schema.Identity.CombGuidIdGeneration.NewGuid()); - return document.Id; - } - - - public override Marten.Internal.Operations.IStorageOperation Update(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpdateDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Insert(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.InsertDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Upsert(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpsertDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Overwrite(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - throw new System.NotSupportedException(); - } - - - public override System.Guid Identity(Marten.Events.Daemon.DeadLetterEvent document) - { - return document.Id; - } - - - public override Marten.Linq.Selectors.ISelector BuildSelector(Marten.Internal.IMartenSession session) - { - return new Marten.Generated.DocumentStorage.IdentityMapDeadLetterEventSelector834684974(session, _document); - } - - - public override Npgsql.NpgsqlCommand BuildLoadCommand(System.Guid id, string tenant) - { - return new NpgsqlCommand(_loaderSql).With("id", id); - } - - - public override Npgsql.NpgsqlCommand BuildLoadManyCommand(System.Guid[] ids, string tenant) - { - return new NpgsqlCommand(_loadArraySql).With("ids", ids); - } - - } - - // END: IdentityMapDeadLetterEventDocumentStorage834684974 - - - // START: DirtyTrackingDeadLetterEventDocumentStorage834684974 - public class DirtyTrackingDeadLetterEventDocumentStorage834684974 : Marten.Internal.Storage.DirtyCheckedDocumentStorage - { - private readonly Marten.Schema.DocumentMapping _document; - - public DirtyTrackingDeadLetterEventDocumentStorage834684974(Marten.Schema.DocumentMapping document) : base(document) - { - _document = document; - } - - - - public override System.Guid AssignIdentity(Marten.Events.Daemon.DeadLetterEvent document, string tenantId, Marten.Storage.IMartenDatabase database) - { - if (document.Id == Guid.Empty) _setter(document, Marten.Schema.Identity.CombGuidIdGeneration.NewGuid()); - return document.Id; - } - - - public override Marten.Internal.Operations.IStorageOperation Update(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpdateDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Insert(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.InsertDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Upsert(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpsertDeadLetterEventOperation834684974 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Overwrite(Marten.Events.Daemon.DeadLetterEvent document, Marten.Internal.IMartenSession session, string tenant) - { - throw new System.NotSupportedException(); - } - - - public override System.Guid Identity(Marten.Events.Daemon.DeadLetterEvent document) - { - return document.Id; - } - - - public override Marten.Linq.Selectors.ISelector BuildSelector(Marten.Internal.IMartenSession session) - { - return new Marten.Generated.DocumentStorage.DirtyTrackingDeadLetterEventSelector834684974(session, _document); - } - - - public override Npgsql.NpgsqlCommand BuildLoadCommand(System.Guid id, string tenant) - { - return new NpgsqlCommand(_loaderSql).With("id", id); - } - - - public override Npgsql.NpgsqlCommand BuildLoadManyCommand(System.Guid[] ids, string tenant) - { - return new NpgsqlCommand(_loadArraySql).With("ids", ids); - } - - } - - // END: DirtyTrackingDeadLetterEventDocumentStorage834684974 - - - // START: DeadLetterEventBulkLoader834684974 - public class DeadLetterEventBulkLoader834684974 : Marten.Internal.CodeGeneration.BulkLoader - { - private readonly Marten.Internal.Storage.IDocumentStorage _storage; - - public DeadLetterEventBulkLoader834684974(Marten.Internal.Storage.IDocumentStorage storage) : base(storage) - { - _storage = storage; - } - - - public const string MAIN_LOADER_SQL = "COPY http.mt_doc_deadletterevent(\"mt_dotnet_type\", \"id\", \"mt_version\", \"data\") FROM STDIN BINARY"; - - public const string TEMP_LOADER_SQL = "COPY mt_doc_deadletterevent_temp(\"mt_dotnet_type\", \"id\", \"mt_version\", \"data\") FROM STDIN BINARY"; - - public const string COPY_NEW_DOCUMENTS_SQL = "insert into http.mt_doc_deadletterevent (\"id\", \"data\", \"mt_version\", \"mt_dotnet_type\", mt_last_modified) (select mt_doc_deadletterevent_temp.\"id\", mt_doc_deadletterevent_temp.\"data\", mt_doc_deadletterevent_temp.\"mt_version\", mt_doc_deadletterevent_temp.\"mt_dotnet_type\", transaction_timestamp() from mt_doc_deadletterevent_temp left join http.mt_doc_deadletterevent on mt_doc_deadletterevent_temp.id = http.mt_doc_deadletterevent.id where http.mt_doc_deadletterevent.id is null)"; - - public const string OVERWRITE_SQL = "update http.mt_doc_deadletterevent target SET data = source.data, mt_version = source.mt_version, mt_dotnet_type = source.mt_dotnet_type, mt_last_modified = transaction_timestamp() FROM mt_doc_deadletterevent_temp source WHERE source.id = target.id"; - - public const string CREATE_TEMP_TABLE_FOR_COPYING_SQL = "create temporary table mt_doc_deadletterevent_temp as select * from http.mt_doc_deadletterevent limit 0"; - - - public override string CreateTempTableForCopying() - { - return CREATE_TEMP_TABLE_FOR_COPYING_SQL; - } - - - public override string CopyNewDocumentsFromTempTable() - { - return COPY_NEW_DOCUMENTS_SQL; - } - - - public override string OverwriteDuplicatesFromTempTable() - { - return OVERWRITE_SQL; - } - - - public override void LoadRow(Npgsql.NpgsqlBinaryImporter writer, Marten.Events.Daemon.DeadLetterEvent document, Marten.Storage.Tenant tenant, Marten.ISerializer serializer) - { - writer.Write(document.GetType().FullName, NpgsqlTypes.NpgsqlDbType.Varchar); - writer.Write(document.Id, NpgsqlTypes.NpgsqlDbType.Uuid); - writer.Write(Marten.Schema.Identity.CombGuidIdGeneration.NewGuid(), NpgsqlTypes.NpgsqlDbType.Uuid); - writer.Write(serializer.ToJson(document), NpgsqlTypes.NpgsqlDbType.Jsonb); - } - - - public override async System.Threading.Tasks.Task LoadRowAsync(Npgsql.NpgsqlBinaryImporter writer, Marten.Events.Daemon.DeadLetterEvent document, Marten.Storage.Tenant tenant, Marten.ISerializer serializer, System.Threading.CancellationToken cancellation) - { - await writer.WriteAsync(document.GetType().FullName, NpgsqlTypes.NpgsqlDbType.Varchar, cancellation); - await writer.WriteAsync(document.Id, NpgsqlTypes.NpgsqlDbType.Uuid, cancellation); - await writer.WriteAsync(Marten.Schema.Identity.CombGuidIdGeneration.NewGuid(), NpgsqlTypes.NpgsqlDbType.Uuid, cancellation); - await writer.WriteAsync(serializer.ToJson(document), NpgsqlTypes.NpgsqlDbType.Jsonb, cancellation); - } - - - public override string MainLoaderSql() - { - return MAIN_LOADER_SQL; - } - - - public override string TempLoaderSql() - { - return TEMP_LOADER_SQL; - } - - } - - // END: DeadLetterEventBulkLoader834684974 - - - // START: DeadLetterEventProvider834684974 - public class DeadLetterEventProvider834684974 : Marten.Internal.Storage.DocumentProvider - { - private readonly Marten.Schema.DocumentMapping _mapping; - - public DeadLetterEventProvider834684974(Marten.Schema.DocumentMapping mapping) : base(new DeadLetterEventBulkLoader834684974(new QueryOnlyDeadLetterEventDocumentStorage834684974(mapping)), new QueryOnlyDeadLetterEventDocumentStorage834684974(mapping), new LightweightDeadLetterEventDocumentStorage834684974(mapping), new IdentityMapDeadLetterEventDocumentStorage834684974(mapping), new DirtyTrackingDeadLetterEventDocumentStorage834684974(mapping)) - { - _mapping = mapping; - } - - - } - - // END: DeadLetterEventProvider834684974 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/DocumentStorage/InvoiceProvider1936131227.cs b/src/Http/WolverineWebApi/Internal/Generated/DocumentStorage/InvoiceProvider1936131227.cs deleted file mode 100644 index 08bb09725..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/DocumentStorage/InvoiceProvider1936131227.cs +++ /dev/null @@ -1,848 +0,0 @@ -// -#pragma warning disable -using Marten.Internal; -using Marten.Internal.Storage; -using Marten.Schema; -using Marten.Schema.Arguments; -using Npgsql; -using System; -using System.Collections.Generic; -using Weasel.Core; -using Weasel.Postgresql; -using WolverineWebApi.Marten; - -namespace Marten.Generated.DocumentStorage -{ - // START: UpsertInvoiceOperation1936131227 - public class UpsertInvoiceOperation1936131227 : Marten.Internal.Operations.StorageOperation - { - private readonly WolverineWebApi.Marten.Invoice _document; - private readonly System.Guid _id; - private readonly System.Collections.Generic.Dictionary _versions; - private readonly Marten.Schema.DocumentMapping _mapping; - - public UpsertInvoiceOperation1936131227(WolverineWebApi.Marten.Invoice document, System.Guid id, System.Collections.Generic.Dictionary versions, Marten.Schema.DocumentMapping mapping) : base(document, id, versions, mapping) - { - _document = document; - _id = id; - _versions = versions; - _mapping = mapping; - } - - - public const string COMMAND_TEXT = "select http.mt_upsert_invoice(?, ?, ?, ?)"; - - - public override void Postprocess(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions) - { - storeVersion(); - } - - - public override System.Threading.Tasks.Task PostprocessAsync(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions, System.Threading.CancellationToken token) - { - storeVersion(); - // Nothing - return System.Threading.Tasks.Task.CompletedTask; - } - - - public override Marten.Internal.Operations.OperationRole Role() - { - return Marten.Internal.Operations.OperationRole.Upsert; - } - - - public override string CommandText() - { - return COMMAND_TEXT; - } - - - public override NpgsqlTypes.NpgsqlDbType DbType() - { - return NpgsqlTypes.NpgsqlDbType.Uuid; - } - - - public override void ConfigureParameters(Npgsql.NpgsqlParameter[] parameters, WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session) - { - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Jsonb; - parameters[0].Value = session.Serializer.ToJson(_document); - // .Net Class Type - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Varchar; - parameters[1].Value = _document.GetType().FullName; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[2].Value = document.Id; - setVersionParameter(parameters[3]); - } - - } - - // END: UpsertInvoiceOperation1936131227 - - - // START: InsertInvoiceOperation1936131227 - public class InsertInvoiceOperation1936131227 : Marten.Internal.Operations.StorageOperation - { - private readonly WolverineWebApi.Marten.Invoice _document; - private readonly System.Guid _id; - private readonly System.Collections.Generic.Dictionary _versions; - private readonly Marten.Schema.DocumentMapping _mapping; - - public InsertInvoiceOperation1936131227(WolverineWebApi.Marten.Invoice document, System.Guid id, System.Collections.Generic.Dictionary versions, Marten.Schema.DocumentMapping mapping) : base(document, id, versions, mapping) - { - _document = document; - _id = id; - _versions = versions; - _mapping = mapping; - } - - - public const string COMMAND_TEXT = "select http.mt_insert_invoice(?, ?, ?, ?)"; - - - public override void Postprocess(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions) - { - storeVersion(); - } - - - public override System.Threading.Tasks.Task PostprocessAsync(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions, System.Threading.CancellationToken token) - { - storeVersion(); - // Nothing - return System.Threading.Tasks.Task.CompletedTask; - } - - - public override Marten.Internal.Operations.OperationRole Role() - { - return Marten.Internal.Operations.OperationRole.Insert; - } - - - public override string CommandText() - { - return COMMAND_TEXT; - } - - - public override NpgsqlTypes.NpgsqlDbType DbType() - { - return NpgsqlTypes.NpgsqlDbType.Uuid; - } - - - public override void ConfigureParameters(Npgsql.NpgsqlParameter[] parameters, WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session) - { - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Jsonb; - parameters[0].Value = session.Serializer.ToJson(_document); - // .Net Class Type - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Varchar; - parameters[1].Value = _document.GetType().FullName; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[2].Value = document.Id; - setVersionParameter(parameters[3]); - } - - } - - // END: InsertInvoiceOperation1936131227 - - - // START: UpdateInvoiceOperation1936131227 - public class UpdateInvoiceOperation1936131227 : Marten.Internal.Operations.StorageOperation - { - private readonly WolverineWebApi.Marten.Invoice _document; - private readonly System.Guid _id; - private readonly System.Collections.Generic.Dictionary _versions; - private readonly Marten.Schema.DocumentMapping _mapping; - - public UpdateInvoiceOperation1936131227(WolverineWebApi.Marten.Invoice document, System.Guid id, System.Collections.Generic.Dictionary versions, Marten.Schema.DocumentMapping mapping) : base(document, id, versions, mapping) - { - _document = document; - _id = id; - _versions = versions; - _mapping = mapping; - } - - - public const string COMMAND_TEXT = "select http.mt_update_invoice(?, ?, ?, ?)"; - - - public override void Postprocess(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions) - { - storeVersion(); - postprocessUpdate(reader, exceptions); - } - - - public override async System.Threading.Tasks.Task PostprocessAsync(System.Data.Common.DbDataReader reader, System.Collections.Generic.IList exceptions, System.Threading.CancellationToken token) - { - storeVersion(); - await postprocessUpdateAsync(reader, exceptions, token); - } - - - public override Marten.Internal.Operations.OperationRole Role() - { - return Marten.Internal.Operations.OperationRole.Update; - } - - - public override string CommandText() - { - return COMMAND_TEXT; - } - - - public override NpgsqlTypes.NpgsqlDbType DbType() - { - return NpgsqlTypes.NpgsqlDbType.Uuid; - } - - - public override void ConfigureParameters(Npgsql.NpgsqlParameter[] parameters, WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session) - { - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Jsonb; - parameters[0].Value = session.Serializer.ToJson(_document); - // .Net Class Type - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Varchar; - parameters[1].Value = _document.GetType().FullName; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[2].Value = document.Id; - setVersionParameter(parameters[3]); - } - - } - - // END: UpdateInvoiceOperation1936131227 - - - // START: QueryOnlyInvoiceSelector1936131227 - public class QueryOnlyInvoiceSelector1936131227 : Marten.Internal.CodeGeneration.DocumentSelectorWithOnlySerializer, Marten.Linq.Selectors.ISelector - { - private readonly Marten.Internal.IMartenSession _session; - private readonly Marten.Schema.DocumentMapping _mapping; - - public QueryOnlyInvoiceSelector1936131227(Marten.Internal.IMartenSession session, Marten.Schema.DocumentMapping mapping) : base(session, mapping) - { - _session = session; - _mapping = mapping; - } - - - - public WolverineWebApi.Marten.Invoice Resolve(System.Data.Common.DbDataReader reader) - { - - WolverineWebApi.Marten.Invoice document; - document = _serializer.FromJson(reader, 0); - return document; - } - - - public async System.Threading.Tasks.Task ResolveAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - - WolverineWebApi.Marten.Invoice document; - document = await _serializer.FromJsonAsync(reader, 0, token).ConfigureAwait(false); - return document; - } - - } - - // END: QueryOnlyInvoiceSelector1936131227 - - - // START: LightweightInvoiceSelector1936131227 - public class LightweightInvoiceSelector1936131227 : Marten.Internal.CodeGeneration.DocumentSelectorWithVersions, Marten.Linq.Selectors.ISelector - { - private readonly Marten.Internal.IMartenSession _session; - private readonly Marten.Schema.DocumentMapping _mapping; - - public LightweightInvoiceSelector1936131227(Marten.Internal.IMartenSession session, Marten.Schema.DocumentMapping mapping) : base(session, mapping) - { - _session = session; - _mapping = mapping; - } - - - - public WolverineWebApi.Marten.Invoice Resolve(System.Data.Common.DbDataReader reader) - { - var id = reader.GetFieldValue(0); - - WolverineWebApi.Marten.Invoice document; - document = _serializer.FromJson(reader, 1); - _session.MarkAsDocumentLoaded(id, document); - return document; - } - - - public async System.Threading.Tasks.Task ResolveAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - var id = await reader.GetFieldValueAsync(0, token); - - WolverineWebApi.Marten.Invoice document; - document = await _serializer.FromJsonAsync(reader, 1, token).ConfigureAwait(false); - _session.MarkAsDocumentLoaded(id, document); - return document; - } - - } - - // END: LightweightInvoiceSelector1936131227 - - - // START: IdentityMapInvoiceSelector1936131227 - public class IdentityMapInvoiceSelector1936131227 : Marten.Internal.CodeGeneration.DocumentSelectorWithIdentityMap, Marten.Linq.Selectors.ISelector - { - private readonly Marten.Internal.IMartenSession _session; - private readonly Marten.Schema.DocumentMapping _mapping; - - public IdentityMapInvoiceSelector1936131227(Marten.Internal.IMartenSession session, Marten.Schema.DocumentMapping mapping) : base(session, mapping) - { - _session = session; - _mapping = mapping; - } - - - - public WolverineWebApi.Marten.Invoice Resolve(System.Data.Common.DbDataReader reader) - { - var id = reader.GetFieldValue(0); - if (_identityMap.TryGetValue(id, out var existing)) return existing; - - WolverineWebApi.Marten.Invoice document; - document = _serializer.FromJson(reader, 1); - _session.MarkAsDocumentLoaded(id, document); - _identityMap[id] = document; - return document; - } - - - public async System.Threading.Tasks.Task ResolveAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - var id = await reader.GetFieldValueAsync(0, token); - if (_identityMap.TryGetValue(id, out var existing)) return existing; - - WolverineWebApi.Marten.Invoice document; - document = await _serializer.FromJsonAsync(reader, 1, token).ConfigureAwait(false); - _session.MarkAsDocumentLoaded(id, document); - _identityMap[id] = document; - return document; - } - - } - - // END: IdentityMapInvoiceSelector1936131227 - - - // START: DirtyTrackingInvoiceSelector1936131227 - public class DirtyTrackingInvoiceSelector1936131227 : Marten.Internal.CodeGeneration.DocumentSelectorWithDirtyChecking, Marten.Linq.Selectors.ISelector - { - private readonly Marten.Internal.IMartenSession _session; - private readonly Marten.Schema.DocumentMapping _mapping; - - public DirtyTrackingInvoiceSelector1936131227(Marten.Internal.IMartenSession session, Marten.Schema.DocumentMapping mapping) : base(session, mapping) - { - _session = session; - _mapping = mapping; - } - - - - public WolverineWebApi.Marten.Invoice Resolve(System.Data.Common.DbDataReader reader) - { - var id = reader.GetFieldValue(0); - if (_identityMap.TryGetValue(id, out var existing)) return existing; - - WolverineWebApi.Marten.Invoice document; - document = _serializer.FromJson(reader, 1); - _session.MarkAsDocumentLoaded(id, document); - _identityMap[id] = document; - StoreTracker(_session, document); - return document; - } - - - public async System.Threading.Tasks.Task ResolveAsync(System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - var id = await reader.GetFieldValueAsync(0, token); - if (_identityMap.TryGetValue(id, out var existing)) return existing; - - WolverineWebApi.Marten.Invoice document; - document = await _serializer.FromJsonAsync(reader, 1, token).ConfigureAwait(false); - _session.MarkAsDocumentLoaded(id, document); - _identityMap[id] = document; - StoreTracker(_session, document); - return document; - } - - } - - // END: DirtyTrackingInvoiceSelector1936131227 - - - // START: QueryOnlyInvoiceDocumentStorage1936131227 - public class QueryOnlyInvoiceDocumentStorage1936131227 : Marten.Internal.Storage.QueryOnlyDocumentStorage - { - private readonly Marten.Schema.DocumentMapping _document; - - public QueryOnlyInvoiceDocumentStorage1936131227(Marten.Schema.DocumentMapping document) : base(document) - { - _document = document; - } - - - - public override System.Guid AssignIdentity(WolverineWebApi.Marten.Invoice document, string tenantId, Marten.Storage.IMartenDatabase database) - { - if (document.Id == Guid.Empty) _setter(document, Marten.Schema.Identity.CombGuidIdGeneration.NewGuid()); - return document.Id; - } - - - public override Marten.Internal.Operations.IStorageOperation Update(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpdateInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Insert(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.InsertInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Upsert(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpsertInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Overwrite(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - throw new System.NotSupportedException(); - } - - - public override System.Guid Identity(WolverineWebApi.Marten.Invoice document) - { - return document.Id; - } - - - public override Marten.Linq.Selectors.ISelector BuildSelector(Marten.Internal.IMartenSession session) - { - return new Marten.Generated.DocumentStorage.QueryOnlyInvoiceSelector1936131227(session, _document); - } - - - public override Npgsql.NpgsqlCommand BuildLoadCommand(System.Guid id, string tenant) - { - return new NpgsqlCommand(_loaderSql).With("id", id); - } - - - public override Npgsql.NpgsqlCommand BuildLoadManyCommand(System.Guid[] ids, string tenant) - { - return new NpgsqlCommand(_loadArraySql).With("ids", ids); - } - - } - - // END: QueryOnlyInvoiceDocumentStorage1936131227 - - - // START: LightweightInvoiceDocumentStorage1936131227 - public class LightweightInvoiceDocumentStorage1936131227 : Marten.Internal.Storage.LightweightDocumentStorage - { - private readonly Marten.Schema.DocumentMapping _document; - - public LightweightInvoiceDocumentStorage1936131227(Marten.Schema.DocumentMapping document) : base(document) - { - _document = document; - } - - - - public override System.Guid AssignIdentity(WolverineWebApi.Marten.Invoice document, string tenantId, Marten.Storage.IMartenDatabase database) - { - if (document.Id == Guid.Empty) _setter(document, Marten.Schema.Identity.CombGuidIdGeneration.NewGuid()); - return document.Id; - } - - - public override Marten.Internal.Operations.IStorageOperation Update(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpdateInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Insert(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.InsertInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Upsert(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpsertInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Overwrite(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - throw new System.NotSupportedException(); - } - - - public override System.Guid Identity(WolverineWebApi.Marten.Invoice document) - { - return document.Id; - } - - - public override Marten.Linq.Selectors.ISelector BuildSelector(Marten.Internal.IMartenSession session) - { - return new Marten.Generated.DocumentStorage.LightweightInvoiceSelector1936131227(session, _document); - } - - - public override Npgsql.NpgsqlCommand BuildLoadCommand(System.Guid id, string tenant) - { - return new NpgsqlCommand(_loaderSql).With("id", id); - } - - - public override Npgsql.NpgsqlCommand BuildLoadManyCommand(System.Guid[] ids, string tenant) - { - return new NpgsqlCommand(_loadArraySql).With("ids", ids); - } - - } - - // END: LightweightInvoiceDocumentStorage1936131227 - - - // START: IdentityMapInvoiceDocumentStorage1936131227 - public class IdentityMapInvoiceDocumentStorage1936131227 : Marten.Internal.Storage.IdentityMapDocumentStorage - { - private readonly Marten.Schema.DocumentMapping _document; - - public IdentityMapInvoiceDocumentStorage1936131227(Marten.Schema.DocumentMapping document) : base(document) - { - _document = document; - } - - - - public override System.Guid AssignIdentity(WolverineWebApi.Marten.Invoice document, string tenantId, Marten.Storage.IMartenDatabase database) - { - if (document.Id == Guid.Empty) _setter(document, Marten.Schema.Identity.CombGuidIdGeneration.NewGuid()); - return document.Id; - } - - - public override Marten.Internal.Operations.IStorageOperation Update(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpdateInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Insert(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.InsertInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Upsert(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpsertInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Overwrite(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - throw new System.NotSupportedException(); - } - - - public override System.Guid Identity(WolverineWebApi.Marten.Invoice document) - { - return document.Id; - } - - - public override Marten.Linq.Selectors.ISelector BuildSelector(Marten.Internal.IMartenSession session) - { - return new Marten.Generated.DocumentStorage.IdentityMapInvoiceSelector1936131227(session, _document); - } - - - public override Npgsql.NpgsqlCommand BuildLoadCommand(System.Guid id, string tenant) - { - return new NpgsqlCommand(_loaderSql).With("id", id); - } - - - public override Npgsql.NpgsqlCommand BuildLoadManyCommand(System.Guid[] ids, string tenant) - { - return new NpgsqlCommand(_loadArraySql).With("ids", ids); - } - - } - - // END: IdentityMapInvoiceDocumentStorage1936131227 - - - // START: DirtyTrackingInvoiceDocumentStorage1936131227 - public class DirtyTrackingInvoiceDocumentStorage1936131227 : Marten.Internal.Storage.DirtyCheckedDocumentStorage - { - private readonly Marten.Schema.DocumentMapping _document; - - public DirtyTrackingInvoiceDocumentStorage1936131227(Marten.Schema.DocumentMapping document) : base(document) - { - _document = document; - } - - - - public override System.Guid AssignIdentity(WolverineWebApi.Marten.Invoice document, string tenantId, Marten.Storage.IMartenDatabase database) - { - if (document.Id == Guid.Empty) _setter(document, Marten.Schema.Identity.CombGuidIdGeneration.NewGuid()); - return document.Id; - } - - - public override Marten.Internal.Operations.IStorageOperation Update(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpdateInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Insert(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.InsertInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Upsert(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - - return new Marten.Generated.DocumentStorage.UpsertInvoiceOperation1936131227 - ( - document, Identity(document), - session.Versions.ForType(), - _document - - ); - } - - - public override Marten.Internal.Operations.IStorageOperation Overwrite(WolverineWebApi.Marten.Invoice document, Marten.Internal.IMartenSession session, string tenant) - { - throw new System.NotSupportedException(); - } - - - public override System.Guid Identity(WolverineWebApi.Marten.Invoice document) - { - return document.Id; - } - - - public override Marten.Linq.Selectors.ISelector BuildSelector(Marten.Internal.IMartenSession session) - { - return new Marten.Generated.DocumentStorage.DirtyTrackingInvoiceSelector1936131227(session, _document); - } - - - public override Npgsql.NpgsqlCommand BuildLoadCommand(System.Guid id, string tenant) - { - return new NpgsqlCommand(_loaderSql).With("id", id); - } - - - public override Npgsql.NpgsqlCommand BuildLoadManyCommand(System.Guid[] ids, string tenant) - { - return new NpgsqlCommand(_loadArraySql).With("ids", ids); - } - - } - - // END: DirtyTrackingInvoiceDocumentStorage1936131227 - - - // START: InvoiceBulkLoader1936131227 - public class InvoiceBulkLoader1936131227 : Marten.Internal.CodeGeneration.BulkLoader - { - private readonly Marten.Internal.Storage.IDocumentStorage _storage; - - public InvoiceBulkLoader1936131227(Marten.Internal.Storage.IDocumentStorage storage) : base(storage) - { - _storage = storage; - } - - - public const string MAIN_LOADER_SQL = "COPY http.mt_doc_invoice(\"mt_dotnet_type\", \"id\", \"mt_version\", \"data\") FROM STDIN BINARY"; - - public const string TEMP_LOADER_SQL = "COPY mt_doc_invoice_temp(\"mt_dotnet_type\", \"id\", \"mt_version\", \"data\") FROM STDIN BINARY"; - - public const string COPY_NEW_DOCUMENTS_SQL = "insert into http.mt_doc_invoice (\"id\", \"data\", \"mt_version\", \"mt_dotnet_type\", mt_last_modified) (select mt_doc_invoice_temp.\"id\", mt_doc_invoice_temp.\"data\", mt_doc_invoice_temp.\"mt_version\", mt_doc_invoice_temp.\"mt_dotnet_type\", transaction_timestamp() from mt_doc_invoice_temp left join http.mt_doc_invoice on mt_doc_invoice_temp.id = http.mt_doc_invoice.id where http.mt_doc_invoice.id is null)"; - - public const string OVERWRITE_SQL = "update http.mt_doc_invoice target SET data = source.data, mt_version = source.mt_version, mt_dotnet_type = source.mt_dotnet_type, mt_last_modified = transaction_timestamp() FROM mt_doc_invoice_temp source WHERE source.id = target.id"; - - public const string CREATE_TEMP_TABLE_FOR_COPYING_SQL = "create temporary table mt_doc_invoice_temp as select * from http.mt_doc_invoice limit 0"; - - - public override string CreateTempTableForCopying() - { - return CREATE_TEMP_TABLE_FOR_COPYING_SQL; - } - - - public override string CopyNewDocumentsFromTempTable() - { - return COPY_NEW_DOCUMENTS_SQL; - } - - - public override string OverwriteDuplicatesFromTempTable() - { - return OVERWRITE_SQL; - } - - - public override void LoadRow(Npgsql.NpgsqlBinaryImporter writer, WolverineWebApi.Marten.Invoice document, Marten.Storage.Tenant tenant, Marten.ISerializer serializer) - { - writer.Write(document.GetType().FullName, NpgsqlTypes.NpgsqlDbType.Varchar); - writer.Write(document.Id, NpgsqlTypes.NpgsqlDbType.Uuid); - writer.Write(Marten.Schema.Identity.CombGuidIdGeneration.NewGuid(), NpgsqlTypes.NpgsqlDbType.Uuid); - writer.Write(serializer.ToJson(document), NpgsqlTypes.NpgsqlDbType.Jsonb); - } - - - public override async System.Threading.Tasks.Task LoadRowAsync(Npgsql.NpgsqlBinaryImporter writer, WolverineWebApi.Marten.Invoice document, Marten.Storage.Tenant tenant, Marten.ISerializer serializer, System.Threading.CancellationToken cancellation) - { - await writer.WriteAsync(document.GetType().FullName, NpgsqlTypes.NpgsqlDbType.Varchar, cancellation); - await writer.WriteAsync(document.Id, NpgsqlTypes.NpgsqlDbType.Uuid, cancellation); - await writer.WriteAsync(Marten.Schema.Identity.CombGuidIdGeneration.NewGuid(), NpgsqlTypes.NpgsqlDbType.Uuid, cancellation); - await writer.WriteAsync(serializer.ToJson(document), NpgsqlTypes.NpgsqlDbType.Jsonb, cancellation); - } - - - public override string MainLoaderSql() - { - return MAIN_LOADER_SQL; - } - - - public override string TempLoaderSql() - { - return TEMP_LOADER_SQL; - } - - } - - // END: InvoiceBulkLoader1936131227 - - - // START: InvoiceProvider1936131227 - public class InvoiceProvider1936131227 : Marten.Internal.Storage.DocumentProvider - { - private readonly Marten.Schema.DocumentMapping _mapping; - - public InvoiceProvider1936131227(Marten.Schema.DocumentMapping mapping) : base(new InvoiceBulkLoader1936131227(new QueryOnlyInvoiceDocumentStorage1936131227(mapping)), new QueryOnlyInvoiceDocumentStorage1936131227(mapping), new LightweightInvoiceDocumentStorage1936131227(mapping), new IdentityMapInvoiceDocumentStorage1936131227(mapping), new DirtyTrackingInvoiceDocumentStorage1936131227(mapping)) - { - _mapping = mapping; - } - - - } - - // END: InvoiceProvider1936131227 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/EventStore/EventStorage.cs b/src/Http/WolverineWebApi/Internal/Generated/EventStore/EventStorage.cs deleted file mode 100644 index 8813d1da4..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/EventStore/EventStorage.cs +++ /dev/null @@ -1,286 +0,0 @@ -// -#pragma warning disable -using Marten; -using Marten.Events; -using System; - -namespace Marten.Generated.EventStore -{ - // START: GeneratedEventDocumentStorage - public class GeneratedEventDocumentStorage : Marten.Events.EventDocumentStorage - { - private readonly Marten.StoreOptions _options; - - public GeneratedEventDocumentStorage(Marten.StoreOptions options) : base(options) - { - _options = options; - } - - - - public override Marten.Internal.Operations.IStorageOperation AppendEvent(Marten.Events.EventGraph events, Marten.Internal.IMartenSession session, Marten.Events.StreamAction stream, Marten.Events.IEvent e) - { - return new Marten.Generated.EventStore.AppendEventOperation(stream, e); - } - - - public override Marten.Internal.Operations.IStorageOperation InsertStream(Marten.Events.StreamAction stream) - { - return new Marten.Generated.EventStore.GeneratedInsertStream(stream); - } - - - public override Marten.Linq.QueryHandlers.IQueryHandler QueryForStream(Marten.Events.StreamAction stream) - { - return new Marten.Generated.EventStore.GeneratedStreamStateQueryHandler(stream.Id); - } - - - public override Marten.Internal.Operations.IStorageOperation UpdateStreamVersion(Marten.Events.StreamAction stream) - { - return new Marten.Generated.EventStore.GeneratedStreamVersionOperation(stream); - } - - - public override void ApplyReaderDataToEvent(System.Data.Common.DbDataReader reader, Marten.Events.IEvent e) - { - if (!reader.IsDBNull(3)) - { - var sequence = reader.GetFieldValue(3); - e.Sequence = sequence; - } - if (!reader.IsDBNull(4)) - { - var id = reader.GetFieldValue(4); - e.Id = id; - } - var streamId = reader.GetFieldValue(5); - e.StreamId = streamId; - if (!reader.IsDBNull(6)) - { - var version = reader.GetFieldValue(6); - e.Version = version; - } - if (!reader.IsDBNull(7)) - { - var timestamp = reader.GetFieldValue(7); - e.Timestamp = timestamp; - } - if (!reader.IsDBNull(8)) - { - var tenantId = reader.GetFieldValue(8); - e.TenantId = tenantId; - } - var isArchived = reader.GetFieldValue(9); - e.IsArchived = isArchived; - } - - - public override async System.Threading.Tasks.Task ApplyReaderDataToEventAsync(System.Data.Common.DbDataReader reader, Marten.Events.IEvent e, System.Threading.CancellationToken token) - { - if (!(await reader.IsDBNullAsync(3, token).ConfigureAwait(false))) - { - var sequence = await reader.GetFieldValueAsync(3, token).ConfigureAwait(false); - e.Sequence = sequence; - } - if (!(await reader.IsDBNullAsync(4, token).ConfigureAwait(false))) - { - var id = await reader.GetFieldValueAsync(4, token).ConfigureAwait(false); - e.Id = id; - } - var streamId = await reader.GetFieldValueAsync(5, token).ConfigureAwait(false); - e.StreamId = streamId; - if (!(await reader.IsDBNullAsync(6, token).ConfigureAwait(false))) - { - var version = await reader.GetFieldValueAsync(6, token).ConfigureAwait(false); - e.Version = version; - } - if (!(await reader.IsDBNullAsync(7, token).ConfigureAwait(false))) - { - var timestamp = await reader.GetFieldValueAsync(7, token).ConfigureAwait(false); - e.Timestamp = timestamp; - } - if (!(await reader.IsDBNullAsync(8, token).ConfigureAwait(false))) - { - var tenantId = await reader.GetFieldValueAsync(8, token).ConfigureAwait(false); - e.TenantId = tenantId; - } - var isArchived = await reader.GetFieldValueAsync(9, token).ConfigureAwait(false); - e.IsArchived = isArchived; - } - - } - - // END: GeneratedEventDocumentStorage - - - // START: AppendEventOperation - public class AppendEventOperation : Marten.Events.Operations.AppendEventOperationBase - { - private readonly Marten.Events.StreamAction _stream; - private readonly Marten.Events.IEvent _e; - - public AppendEventOperation(Marten.Events.StreamAction stream, Marten.Events.IEvent e) : base(stream, e) - { - _stream = stream; - _e = e; - } - - - public const string SQL = "insert into http.mt_events (data, type, mt_dotnet_type, seq_id, id, stream_id, version, timestamp, tenant_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)"; - - - public override void ConfigureCommand(Weasel.Postgresql.CommandBuilder builder, Marten.Internal.IMartenSession session) - { - var parameters = builder.AppendWithParameters(SQL); - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Jsonb; - parameters[0].Value = session.Serializer.ToJson(Event.Data); - parameters[1].Value = Event.EventTypeName != null ? (object)Event.EventTypeName : System.DBNull.Value; - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Text; - parameters[2].Value = Event.DotNetTypeName != null ? (object)Event.DotNetTypeName : System.DBNull.Value; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Text; - parameters[3].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Bigint; - parameters[3].Value = Event.Sequence; - parameters[4].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[4].Value = Event.Id; - parameters[5].Value = Stream.Id; - parameters[5].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[6].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Bigint; - parameters[6].Value = Event.Version; - parameters[7].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.TimestampTz; - parameters[7].Value = Event.Timestamp; - parameters[8].Value = Stream.TenantId != null ? (object)Stream.TenantId : System.DBNull.Value; - parameters[8].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Text; - } - - } - - // END: AppendEventOperation - - - // START: GeneratedInsertStream - public class GeneratedInsertStream : Marten.Events.Operations.InsertStreamBase - { - private readonly Marten.Events.StreamAction _stream; - - public GeneratedInsertStream(Marten.Events.StreamAction stream) : base(stream) - { - _stream = stream; - } - - - public const string SQL = "insert into http.mt_streams (id, type, version, tenant_id) values (?, ?, ?, ?)"; - - - public override void ConfigureCommand(Weasel.Postgresql.CommandBuilder builder, Marten.Internal.IMartenSession session) - { - var parameters = builder.AppendWithParameters(SQL); - parameters[0].Value = Stream.Id; - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[1].Value = Stream.AggregateTypeName != null ? (object)Stream.AggregateTypeName : System.DBNull.Value; - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Text; - parameters[2].Value = Stream.Version; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Bigint; - parameters[3].Value = Stream.TenantId != null ? (object)Stream.TenantId : System.DBNull.Value; - parameters[3].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Text; - } - - } - - // END: GeneratedInsertStream - - - // START: GeneratedStreamStateQueryHandler - public class GeneratedStreamStateQueryHandler : Marten.Events.Querying.StreamStateQueryHandler - { - private readonly System.Guid _streamId; - - public GeneratedStreamStateQueryHandler(System.Guid streamId) - { - _streamId = streamId; - } - - - public const string SQL = "select id, version, type, timestamp, created as timestamp, is_archived from http.mt_streams where id = ?"; - - - public override void ConfigureCommand(Weasel.Postgresql.CommandBuilder builder, Marten.Internal.IMartenSession session) - { - var npgsqlParameterArray = builder.AppendWithParameters(SQL); - npgsqlParameterArray[0].Value = _streamId; - npgsqlParameterArray[0].DbType = System.Data.DbType.Guid; - } - - - public override Marten.Events.StreamState Resolve(Marten.Internal.IMartenSession session, System.Data.Common.DbDataReader reader) - { - var streamState = new Marten.Events.StreamState(); - var id = reader.GetFieldValue(0); - streamState.Id = id; - var version = reader.GetFieldValue(1); - streamState.Version = version; - SetAggregateType(streamState, reader, session); - var lastTimestamp = reader.GetFieldValue(3); - streamState.LastTimestamp = lastTimestamp; - var created = reader.GetFieldValue(4); - streamState.Created = created; - var isArchived = reader.GetFieldValue(5); - streamState.IsArchived = isArchived; - return streamState; - } - - - public override async System.Threading.Tasks.Task ResolveAsync(Marten.Internal.IMartenSession session, System.Data.Common.DbDataReader reader, System.Threading.CancellationToken token) - { - var streamState = new Marten.Events.StreamState(); - var id = await reader.GetFieldValueAsync(0, token).ConfigureAwait(false); - streamState.Id = id; - var version = await reader.GetFieldValueAsync(1, token).ConfigureAwait(false); - streamState.Version = version; - await SetAggregateTypeAsync(streamState, reader, session, token).ConfigureAwait(false); - var lastTimestamp = await reader.GetFieldValueAsync(3, token).ConfigureAwait(false); - streamState.LastTimestamp = lastTimestamp; - var created = await reader.GetFieldValueAsync(4, token).ConfigureAwait(false); - streamState.Created = created; - var isArchived = await reader.GetFieldValueAsync(5, token).ConfigureAwait(false); - streamState.IsArchived = isArchived; - return streamState; - } - - } - - // END: GeneratedStreamStateQueryHandler - - - // START: GeneratedStreamVersionOperation - public class GeneratedStreamVersionOperation : Marten.Events.Operations.UpdateStreamVersion - { - private readonly Marten.Events.StreamAction _stream; - - public GeneratedStreamVersionOperation(Marten.Events.StreamAction stream) : base(stream) - { - _stream = stream; - } - - - public const string SQL = "update http.mt_streams set version = ? where id = ? and version = ?"; - - - public override void ConfigureCommand(Weasel.Postgresql.CommandBuilder builder, Marten.Internal.IMartenSession session) - { - var parameters = builder.AppendWithParameters(SQL); - parameters[0].Value = Stream.Version; - parameters[0].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Bigint; - parameters[1].Value = Stream.Id; - parameters[1].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Uuid; - parameters[2].Value = Stream.ExpectedVersionOnServer; - parameters[2].NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Bigint; - } - - } - - // END: GeneratedStreamVersionOperation - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/BookReservationHandler1573485708.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/BookReservationHandler1573485708.cs deleted file mode 100644 index 2be229e2c..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/BookReservationHandler1573485708.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -#pragma warning disable -using Microsoft.Extensions.Logging; -using Wolverine.Marten.Publishing; - -namespace Internal.Generated.WolverineHandlers -{ - // START: BookReservationHandler1573485708 - public class BookReservationHandler1573485708 : Wolverine.Runtime.Handlers.MessageHandler - { - private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; - private readonly Microsoft.Extensions.Logging.ILogger _logger; - - public BookReservationHandler1573485708(Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Microsoft.Extensions.Logging.ILogger logger) - { - _outboxedSessionFactory = outboxedSessionFactory; - _logger = logger; - } - - - - public override async System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(context); - // The actual message body - var bookReservation = (WolverineWebApi.BookReservation)context.Envelope.Message; - - string sagaId = context.Envelope.SagaId ?? bookReservation.Id; - if (string.IsNullOrEmpty(sagaId)) throw new Wolverine.Persistence.Sagas.IndeterminateSagaStateIdException(context.Envelope); - - // Try to load the existing saga document - var reservation = await documentSession.LoadAsync(sagaId, cancellation).ConfigureAwait(false); - if (reservation == null) - { - throw new Wolverine.Persistence.Sagas.UnknownSagaException(typeof(WolverineWebApi.Reservation), sagaId); - } - - else - { - - // The actual message execution - reservation.Handle(bookReservation, _logger); - - // Delete the saga if completed, otherwise update it - if (reservation.IsCompleted()) - { - - // Register the document operation with the current session - documentSession.Delete(reservation); - } - - else - { - - // Register the document operation with the current session - documentSession.Update(reservation); - } - - - // Commit all pending changes - await documentSession.SaveChangesAsync(cancellation).ConfigureAwait(false); - - } - - } - - } - - // END: BookReservationHandler1573485708 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/CreateTodoHandler1445015324.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/CreateTodoHandler1445015324.cs deleted file mode 100644 index b5d0cee05..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/CreateTodoHandler1445015324.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -#pragma warning disable -using Wolverine.Marten.Publishing; - -namespace Internal.Generated.WolverineHandlers -{ - // START: CreateTodoHandler1445015324 - public class CreateTodoHandler1445015324 : Wolverine.Runtime.Handlers.MessageHandler - { - private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; - - public CreateTodoHandler1445015324(Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) - { - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(context); - // The actual message body - var createTodo = (WolverineWebApi.Samples.CreateTodo)context.Envelope.Message; - - - // The actual message execution - (var outgoing1, var outgoing2) = WolverineWebApi.Samples.CreateTodoHandler.Handle(createTodo, documentSession); - - - // Outgoing, cascaded message - await context.EnqueueCascadingAsync(outgoing1).ConfigureAwait(false); - - - // Outgoing, cascaded message - await context.EnqueueCascadingAsync(outgoing2).ConfigureAwait(false); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(cancellation).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await context.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - } - - } - - // END: CreateTodoHandler1445015324 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/CustomRequestHandler1116913013.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/CustomRequestHandler1116913013.cs deleted file mode 100644 index 8e8595a12..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/CustomRequestHandler1116913013.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: CustomRequestHandler1116913013 - public class CustomRequestHandler1116913013 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override async System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var customRequest = (WolverineWebApi.CustomRequest)context.Envelope.Message; - - - // The actual message execution - var outgoing1 = WolverineWebApi.MessageHandler.Handle(customRequest); - - - // Outgoing, cascaded message - await context.EnqueueCascadingAsync(outgoing1).ConfigureAwait(false); - - } - - } - - // END: CustomRequestHandler1116913013 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/DELETE_validate_user_compound.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/DELETE_validate_user_compound.cs deleted file mode 100644 index 27d184a5d..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/DELETE_validate_user_compound.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -#pragma warning disable -using FluentValidation; -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Http.FluentValidation; - -namespace Internal.Generated.WolverineHandlers -{ - // START: DELETE_validate_user_compound - public class DELETE_validate_user_compound : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly FluentValidation.IValidator _validator; - private readonly Wolverine.Http.FluentValidation.IProblemDetailSource _problemDetailSource; - - public DELETE_validate_user_compound(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, FluentValidation.IValidator validator, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _validator = validator; - _problemDetailSource = problemDetailSource; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Reading the request body via JSON deserialization - var (cmd, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // Execute FluentValidation validators - var result1 = await Wolverine.Http.FluentValidation.Internals.FluentValidationHttpExecutor.ExecuteOne(_validator, _problemDetailSource, cmd).ConfigureAwait(false); - - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - var user = WolverineWebApi.Validation.ValidatedCompoundEndpoint.Load(cmd); - var result2 = WolverineWebApi.Validation.ValidatedCompoundEndpoint.Validate(user); - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result2 is Wolverine.Http.WolverineContinue)) - { - await result2.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var result_of_Handle = WolverineWebApi.Validation.ValidatedCompoundEndpoint.Handle(cmd, user); - - await WriteString(httpContext, result_of_Handle); - } - - } - - // END: DELETE_validate_user_compound - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/DataHandler620835457.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/DataHandler620835457.cs deleted file mode 100644 index 293c4d805..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/DataHandler620835457.cs +++ /dev/null @@ -1,30 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: DataHandler620835457 - public class DataHandler620835457 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - var dataHandler = new WolverineWebApi.DataHandler(); - // The actual message body - var data = (WolverineWebApi.Data)context.Envelope.Message; - - - // The actual message execution - dataHandler.Handle(data); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: DataHandler620835457 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_.cs deleted file mode 100644 index 0e5503a86..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_ - public class GET_ : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var homeEndpoint = new WolverineWebApi.HomeEndpoint(); - - // The actual HTTP request handler execution - var result = homeEndpoint.Index(); - - return result.ExecuteAsync(httpContext); - } - - } - - // END: GET_ - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_age_age.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_age_age.cs deleted file mode 100644 index 0d0d849db..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_age_age.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_age_age - public class GET_age_age : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_age_age(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - if (!int.TryParse((string)httpContext.GetRouteValue("age"), out var age)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_IntRouteArgument = WolverineWebApi.TestEndpoints.IntRouteArgument(age); - - await WriteString(httpContext, result_of_IntRouteArgument); - } - - } - - // END: GET_age_age - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_api_myapp_registration_price.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_api_myapp_registration_price.cs deleted file mode 100644 index 43d4d83e3..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_api_myapp_registration_price.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_api_myapp_registration_price - public class GET_api_myapp_registration_price : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_api_myapp_registration_price(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - int numberOfMembers = default; - int.TryParse(httpContext.Request.Query["numberOfMembers"], System.Globalization.CultureInfo.InvariantCulture, out numberOfMembers); - - // The actual HTTP request handler execution - var decimalValue_response = WolverineWebApi.Bugs.MyAppLandingEndpoint.GetRegistrationPrice(numberOfMembers); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, decimalValue_response); - } - - } - - // END: GET_api_myapp_registration_price - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_correlation.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_correlation.cs deleted file mode 100644 index 2cbfc3e53..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_correlation.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_correlation - public class GET_correlation : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public GET_correlation(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - - // The actual HTTP request handler execution - var result_of_GetCorrelation = WolverineWebApi.TracingEndpoint.GetCorrelation(messageContext); - - await WriteString(httpContext, result_of_GetCorrelation); - } - - } - - // END: GET_correlation - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_data_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_data_id.cs deleted file mode 100644 index 03be4a700..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_data_id.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_data_id - 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; - - public GET_data_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var serviceEndpoints = new WolverineWebApi.ServiceEndpoints(); - 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("id"), out var id)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var data_response = await serviceEndpoints.GetData(id, documentSession).ConfigureAwait(false); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, data_response); - } - - } - - // END: GET_data_id - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_discovered.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_discovered.cs deleted file mode 100644 index a2411a491..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_discovered.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_discovered - public class GET_discovered : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_discovered(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - - // The actual HTTP request handler execution - var result_of_Get = WolverineWebApi.DiscoverMe.Get(); - - await WriteString(httpContext, result_of_Get); - } - - } - - // END: GET_discovered - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_enum_direction.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_enum_direction.cs deleted file mode 100644 index cf6f12731..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_enum_direction.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_enum_direction - public class GET_enum_direction : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_enum_direction(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - if (!WolverineWebApi.Direction.TryParse((string)httpContext.GetRouteValue("direction"), true, out WolverineWebApi.Direction direction)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - - // The actual HTTP request handler execution - var result_of_ReadEnumArgument = fakeEndpoint.ReadEnumArgument(direction); - - await WriteString(httpContext, result_of_ReadEnumArgument); - } - - } - - // END: GET_enum_direction - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello.cs deleted file mode 100644 index facc55454..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_fake_hello - public class GET_fake_hello : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_fake_hello(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - var result_of_SayHello = fakeEndpoint.SayHello(); - - await WriteString(httpContext, result_of_SayHello); - } - - } - - // END: GET_fake_hello - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello_async.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello_async.cs deleted file mode 100644 index a33e186c5..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello_async.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_fake_hello_async - public class GET_fake_hello_async : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_fake_hello_async(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - var result_of_SayHelloAsync = await fakeEndpoint.SayHelloAsync().ConfigureAwait(false); - - await WriteString(httpContext, result_of_SayHelloAsync); - } - - } - - // END: GET_fake_hello_async - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello_async2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello_async2.cs deleted file mode 100644 index e307502d7..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_fake_hello_async2.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_fake_hello_async2 - public class GET_fake_hello_async2 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_fake_hello_async2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - var result_of_SayHelloAsync2 = await fakeEndpoint.SayHelloAsync2(); - - await WriteString(httpContext, result_of_SayHelloAsync2); - } - - } - - // END: GET_fake_hello_async2 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_accepts.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_accepts.cs deleted file mode 100644 index 068c4c59f..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_accepts.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_headers_accepts - public class GET_headers_accepts : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_headers_accepts(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var headerUsingEndpoint = new WolverineWebApi.HeaderUsingEndpoint(); - // Retrieve header value from the request - var accepts = ReadSingleHeaderValue(httpContext, "accepts"); - - // The actual HTTP request handler execution - var result_of_GetETag = headerUsingEndpoint.GetETag(accepts); - - await WriteString(httpContext, result_of_GetETag); - } - - } - - // END: GET_headers_accepts - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_int.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_int.cs deleted file mode 100644 index d1d4f1248..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_int.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_headers_int - public class GET_headers_int : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_headers_int(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var headerUsingEndpoint = new WolverineWebApi.HeaderUsingEndpoint(); - int number = default; - int.TryParse(ReadSingleHeaderValue(httpContext, "x-wolverine"), out number); - - // The actual HTTP request handler execution - var result_of_Get = headerUsingEndpoint.Get(number); - - await WriteString(httpContext, result_of_Get); - } - - } - - // END: GET_headers_int - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_simple.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_simple.cs deleted file mode 100644 index ed5f92630..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_headers_simple.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_headers_simple - public class GET_headers_simple : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_headers_simple(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var headerUsingEndpoint = new WolverineWebApi.HeaderUsingEndpoint(); - // Retrieve header value from the request - var name = ReadSingleHeaderValue(httpContext, "x-wolverine"); - - // The actual HTTP request handler execution - var result_of_Get = headerUsingEndpoint.Get(name); - - await WriteString(httpContext, result_of_Get); - } - - } - - // END: GET_headers_simple - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_hello.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_hello.cs deleted file mode 100644 index 987d91b87..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_hello.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_hello - public class GET_hello : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_hello(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_Speak = WolverineWebApi.TestEndpoints.Speak(); - - await WriteString(httpContext, result_of_Speak); - } - - } - - // END: GET_hello - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_context.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_context.cs deleted file mode 100644 index 44cdafa4a..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_context.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_http_context - public class GET_http_context : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_http_context(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var httpContextEndpoints = new WolverineWebApi.HttpContextEndpoints(); - - // The actual HTTP request handler execution - httpContextEndpoints.UseHttpContext(httpContext); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: GET_http_context - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_identifier.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_identifier.cs deleted file mode 100644 index 944bf1e44..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_identifier.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_http_identifier - public class GET_http_identifier : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_http_identifier(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var httpContextEndpoints = new WolverineWebApi.HttpContextEndpoints(); - - // The actual HTTP request handler execution - var result_of_UseTraceIdentifier = httpContextEndpoints.UseTraceIdentifier(httpContext.TraceIdentifier); - - await WriteString(httpContext, result_of_UseTraceIdentifier); - } - - } - - // END: GET_http_identifier - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_principal.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_principal.cs deleted file mode 100644 index fcbbe54fc..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_principal.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_http_principal - public class GET_http_principal : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_http_principal(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var httpContextEndpoints = new WolverineWebApi.HttpContextEndpoints(); - - // The actual HTTP request handler execution - httpContextEndpoints.UseClaimsPrincipal(httpContext.User); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: GET_http_principal - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_request.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_request.cs deleted file mode 100644 index 5c5e89a84..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_request.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_http_request - public class GET_http_request : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_http_request(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var httpContextEndpoints = new WolverineWebApi.HttpContextEndpoints(); - - // The actual HTTP request handler execution - httpContextEndpoints.UseHttpRequest(httpContext.Request); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: GET_http_request - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_response.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_response.cs deleted file mode 100644 index a3ba0647d..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_http_response.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_http_response - public class GET_http_response : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_http_response(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var httpContextEndpoints = new WolverineWebApi.HttpContextEndpoints(); - - // The actual HTTP request handler execution - httpContextEndpoints.UseHttpResponse(httpContext.Response); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: GET_http_response - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_id.cs deleted file mode 100644 index 8e1d3e35f..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_id.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_invoices_id - 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; - - public GET_invoices_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - if (!System.Guid.TryParse((string)httpContext.GetRouteValue("id"), out var id)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - var invoice = await documentSession.LoadAsync(id, httpContext.RequestAborted).ConfigureAwait(false); - - // The actual HTTP request handler execution - var invoice_response = WolverineWebApi.Marten.InvoicesEndpoint.Get(invoice); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, invoice_response); - } - - } - - // END: GET_invoices_id - - -} - 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 deleted file mode 100644 index 9b6b6a232..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_longhand_id.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_invoices_longhand_id - 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; - - public GET_invoices_longhand_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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 querySession = _outboxedSessionFactory.QuerySession(messageContext); - System.Guid id = default; - System.Guid.TryParse(httpContext.Request.Query["id"], System.Globalization.CultureInfo.InvariantCulture, out id); - - // The actual HTTP request handler execution - var result = await WolverineWebApi.Marten.InvoicesEndpoint.GetInvoice(id, querySession, httpContext.RequestAborted).ConfigureAwait(false); - - await result.ExecuteAsync(httpContext).ConfigureAwait(false); - } - - } - - // END: GET_invoices_longhand_id - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_message_message.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_message_message.cs deleted file mode 100644 index 2f10a1007..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_message_message.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using WolverineWebApi; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_message_message - public class GET_message_message : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly WolverineWebApi.Recorder _recorder; - - public GET_message_message(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, WolverineWebApi.Recorder recorder) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _recorder = recorder; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var serviceEndpoints = new WolverineWebApi.ServiceEndpoints(); - var message = (string)httpContext.GetRouteValue("message"); - - // The actual HTTP request handler execution - var result_of_GetMessage = serviceEndpoints.GetMessage(message, _recorder); - - await WriteString(httpContext, result_of_GetMessage); - } - - } - - // END: GET_message_message - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_middleware_intrinsic.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_middleware_intrinsic.cs deleted file mode 100644 index fd91d11e6..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_middleware_intrinsic.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using WolverineWebApi; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_middleware_intrinsic - public class GET_middleware_intrinsic : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly WolverineWebApi.Recorder _recorder; - - public GET_middleware_intrinsic(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, WolverineWebApi.Recorder recorder) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _recorder = recorder; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var beforeAndAfterEndpoint = new WolverineWebApi.BeforeAndAfterEndpoint(); - WolverineWebApi.BeforeAndAfterEndpoint.Before(_recorder); - - // The actual HTTP request handler execution - var result_of_GetRequest = beforeAndAfterEndpoint.GetRequest(_recorder); - - WolverineWebApi.BeforeAndAfterEndpoint.After(_recorder); - await WriteString(httpContext, result_of_GetRequest); - } - - } - - // END: GET_middleware_intrinsic - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_middleware_simple.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_middleware_simple.cs deleted file mode 100644 index eb2522ed0..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_middleware_simple.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using WolverineWebApi; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_middleware_simple - public class GET_middleware_simple : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly WolverineWebApi.Recorder _recorder; - - public GET_middleware_simple(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, WolverineWebApi.Recorder recorder) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _recorder = recorder; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var middlewareEndpoints = new WolverineWebApi.MiddlewareEndpoints(); - WolverineWebApi.BeforeAndAfterMiddleware.Before(_recorder); - - // The actual HTTP request handler execution - var result_of_GetRequest = middlewareEndpoints.GetRequest(_recorder); - - WolverineWebApi.BeforeAndAfterMiddleware.After(_recorder); - await WriteString(httpContext, result_of_GetRequest); - } - - } - - // END: GET_middleware_simple - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_name_name.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_name_name.cs deleted file mode 100644 index 94d53159a..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_name_name.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_name_name - public class GET_name_name : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_name_name(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var name = (string)httpContext.GetRouteValue("name"); - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_SimpleStringRouteArgument = WolverineWebApi.TestEndpoints.SimpleStringRouteArgument(name); - - await WriteString(httpContext, result_of_SimpleStringRouteArgument); - } - - } - - // END: GET_name_name - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_now.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_now.cs deleted file mode 100644 index 2aecd88c1..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_now.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_now - public class GET_now : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_now(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - - // The actual HTTP request handler execution - var result_of_GetNow = WolverineWebApi.CustomParameterEndpoint.GetNow(System.DateTimeOffset.UtcNow); - - await WriteString(httpContext, result_of_GetNow); - } - - } - - // END: GET_now - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_decimal.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_decimal.cs deleted file mode 100644 index b352a57f9..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_decimal.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using WolverineWebApi; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_querystring_decimal - public class GET_querystring_decimal : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly WolverineWebApi.Recorder _recorder; - - public GET_querystring_decimal(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, WolverineWebApi.Recorder recorder) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _recorder = recorder; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - System.Decimal amount = default; - System.Decimal.TryParse(httpContext.Request.Query["amount"], System.Globalization.CultureInfo.InvariantCulture, out amount); - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_UseQueryStringParsing = WolverineWebApi.TestEndpoints.UseQueryStringParsing(_recorder, amount); - - await WriteString(httpContext, result_of_UseQueryStringParsing); - } - - } - - // END: GET_querystring_decimal - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_enum.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_enum.cs deleted file mode 100644 index b9db56c1a..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_enum.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_querystring_enum - public class GET_querystring_enum : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_querystring_enum(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - WolverineWebApi.Direction direction = default; - WolverineWebApi.Direction.TryParse(httpContext.Request.Query["direction"], out direction); - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_UsingEnumQuerystring = WolverineWebApi.TestEndpoints.UsingEnumQuerystring(direction); - - await WriteString(httpContext, result_of_UsingEnumQuerystring); - } - - } - - // END: GET_querystring_enum - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_enum_nullable.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_enum_nullable.cs deleted file mode 100644 index 5d31aa5b3..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_enum_nullable.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_querystring_enum_nullable - public class GET_querystring_enum_nullable : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_querystring_enum_nullable(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - WolverineWebApi.Direction? direction = null; - if (WolverineWebApi.Direction.TryParse(httpContext.Request.Query["direction"], out var directionParsed)) direction = directionParsed; - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_UsingNullableEnumQuerystring = WolverineWebApi.TestEndpoints.UsingNullableEnumQuerystring(direction); - - await WriteString(httpContext, result_of_UsingNullableEnumQuerystring); - } - - } - - // END: GET_querystring_enum_nullable - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_int.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_int.cs deleted file mode 100644 index 323321c85..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_int.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using WolverineWebApi; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_querystring_int - public class GET_querystring_int : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly WolverineWebApi.Recorder _recorder; - - public GET_querystring_int(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, WolverineWebApi.Recorder recorder) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _recorder = recorder; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - int? age = null; - if (int.TryParse(httpContext.Request.Query["age"], System.Globalization.CultureInfo.InvariantCulture, out var ageParsed)) age = ageParsed; - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_UsingQueryStringParsing = WolverineWebApi.TestEndpoints.UsingQueryStringParsing(_recorder, age); - - await WriteString(httpContext, result_of_UsingQueryStringParsing); - } - - } - - // END: GET_querystring_int - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_int_nullable.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_int_nullable.cs deleted file mode 100644 index 5f57729e4..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_int_nullable.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_querystring_int_nullable - public class GET_querystring_int_nullable : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_querystring_int_nullable(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - int? age = null; - if (int.TryParse(httpContext.Request.Query["age"], System.Globalization.CultureInfo.InvariantCulture, out var ageParsed)) age = ageParsed; - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_UsingQueryStringParsingNullable = WolverineWebApi.TestEndpoints.UsingQueryStringParsingNullable(age); - - await WriteString(httpContext, result_of_UsingQueryStringParsingNullable); - } - - } - - // END: GET_querystring_int_nullable - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_string.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_string.cs deleted file mode 100644 index 44e55e0d6..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_querystring_string.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_querystring_string - public class GET_querystring_string : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_querystring_string(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - string name = httpContext.Request.Query["name"].FirstOrDefault(); - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var result_of_UsingQueryString = WolverineWebApi.TestEndpoints.UsingQueryString(name); - - await WriteString(httpContext, result_of_UsingQueryString); - } - - } - - // END: GET_querystring_string - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_read_name.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_read_name.cs deleted file mode 100644 index 66da4afed..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_read_name.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_read_name - public class GET_read_name : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_read_name(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - var name = (string)httpContext.GetRouteValue("name"); - - // The actual HTTP request handler execution - var result_of_ReadStringArgument = fakeEndpoint.ReadStringArgument(name); - - await WriteString(httpContext, result_of_ReadStringArgument); - } - - } - - // END: GET_read_name - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response.cs deleted file mode 100644 index d3c1bea10..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_response - public class GET_response : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_response(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - var bigResponse_response = fakeEndpoint.GetResponse(); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, bigResponse_response); - } - - } - - // END: GET_response - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response2.cs deleted file mode 100644 index 28cce6ae4..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response2.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_response2 - public class GET_response2 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_response2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - var bigResponse_response = await fakeEndpoint.GetResponseAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, bigResponse_response); - } - - } - - // END: GET_response2 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response3.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response3.cs deleted file mode 100644 index 8f68b444b..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_response3.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_response3 - public class GET_response3 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_response3(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - var bigResponse_response = await fakeEndpoint.GetResponseAsync2(); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, bigResponse_response); - } - - } - - // END: GET_response3 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_result.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_result.cs deleted file mode 100644 index 5f34df967..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_result.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_result - public class GET_result : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_result(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - - // The actual HTTP request handler execution - var result = WolverineWebApi.ResultEndpoints.GetResult(); - - return result.ExecuteAsync(httpContext); - } - - } - - // END: GET_result - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_result_async.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_result_async.cs deleted file mode 100644 index 19eacbc71..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_result_async.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_result_async - public class GET_result_async : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_result_async(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - - // The actual HTTP request handler execution - var result = await WolverineWebApi.ResultEndpoints.GetAsyncResult().ConfigureAwait(false); - - await result.ExecuteAsync(httpContext).ConfigureAwait(false); - } - - } - - // END: GET_result_async - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_results_static.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_results_static.cs deleted file mode 100644 index 2d8d30c43..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_results_static.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_results_static - public class GET_results_static : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_results_static(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var arithmeticResults_response = WolverineWebApi.TestEndpoints.FetchStaticResults(); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, arithmeticResults_response); - } - - } - - // END: GET_results_static - - -} - 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 deleted file mode 100644 index 85d2c5cb3..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_swagger_users_userId.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_swagger_users_userId - 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; - - public GET_swagger_users_userId(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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 querySession = _outboxedSessionFactory.QuerySession(messageContext); - var userId = (string)httpContext.GetRouteValue("userId"); - - // The actual HTTP request handler execution - var userProfile_response = await WolverineWebApi.SwaggerEndpoints.GetUserProfile(userId, querySession).ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, userProfile_response); - } - - } - - // END: GET_swagger_users_userId - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_timed.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_timed.cs deleted file mode 100644 index 4ac4277f6..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_timed.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using Microsoft.Extensions.Logging; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_timed - public class GET_timed : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Microsoft.Extensions.Logging.ILogger _loggerForMessage; - - public GET_timed(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Microsoft.Extensions.Logging.ILogger loggerForMessage) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _loggerForMessage = loggerForMessage; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var stopwatchMiddleware = new WolverineWebApi.StopwatchMiddleware(); - var measuredEndpoint = new WolverineWebApi.MeasuredEndpoint(); - stopwatchMiddleware.Before(); - - // The actual HTTP request handler execution - var result_of_Get = await measuredEndpoint.Get().ConfigureAwait(false); - - stopwatchMiddleware.Finally(((Microsoft.Extensions.Logging.ILogger)_loggerForMessage), httpContext); - await WriteString(httpContext, result_of_Get); - } - - } - - // END: GET_timed - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_trace.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_trace.cs deleted file mode 100644 index cb5c68d09..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_trace.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_trace - public class GET_trace : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_trace(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var traceEndpoint = new WolverineWebApi.TraceEndpoint(); - - // The actual HTTP request handler execution - var result_of_Hey = traceEndpoint.Hey(); - - await WriteString(httpContext, result_of_Hey); - } - - } - - // END: GET_trace - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_wildcard_name.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_wildcard_name.cs deleted file mode 100644 index 089f2853d..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_wildcard_name.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_wildcard_name - public class GET_wildcard_name : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public GET_wildcard_name(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var wildcardEndpoint = new WolverineWebApi.WildcardEndpoint(); - var name = (string)httpContext.GetRouteValue("name"); - - // The actual HTTP request handler execution - var result_of_Wildcard = wildcardEndpoint.Wildcard(name); - - await WriteString(httpContext, result_of_Wildcard); - } - - } - - // END: GET_wildcard_name - - -} - 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 deleted file mode 100644 index 01df1d3c7..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_write_to_id.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: GET_write_to_id - 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; - - public GET_write_to_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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 querySession = _outboxedSessionFactory.QuerySession(messageContext); - if (!System.Guid.TryParse((string)httpContext.GetRouteValue("id"), out var id)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - - // The actual HTTP request handler execution - await WolverineWebApi.WriteToEndpoints.GetAssetCodeView(id, querySession, httpContext).ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: GET_write_to_id - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage1Handler862252953.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage1Handler862252953.cs deleted file mode 100644 index 28ebbeaae..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage1Handler862252953.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: HttpMessage1Handler862252953 - public class HttpMessage1Handler862252953 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var httpMessage1 = (WolverineWebApi.HttpMessage1)context.Envelope.Message; - - - // The actual message execution - WolverineWebApi.MessageHandler.Handle(httpMessage1); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: HttpMessage1Handler862252953 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage2Handler1265537480.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage2Handler1265537480.cs deleted file mode 100644 index 3bf1a85a0..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage2Handler1265537480.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: HttpMessage2Handler1265537480 - public class HttpMessage2Handler1265537480 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var httpMessage2 = (WolverineWebApi.HttpMessage2)context.Envelope.Message; - - - // The actual message execution - WolverineWebApi.MessageHandler.Handle(httpMessage2); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: HttpMessage2Handler1265537480 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage3Handler300546461.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage3Handler300546461.cs deleted file mode 100644 index 06ecc2c1f..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage3Handler300546461.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: HttpMessage3Handler300546461 - public class HttpMessage3Handler300546461 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var httpMessage3 = (WolverineWebApi.HttpMessage3)context.Envelope.Message; - - - // The actual message execution - WolverineWebApi.MessageHandler.Handle(httpMessage3); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: HttpMessage3Handler300546461 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage4Handler102738066.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage4Handler102738066.cs deleted file mode 100644 index aca0165db..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage4Handler102738066.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: HttpMessage4Handler102738066 - public class HttpMessage4Handler102738066 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var httpMessage4 = (WolverineWebApi.HttpMessage4)context.Envelope.Message; - - - // The actual message execution - WolverineWebApi.MessageHandler.Handle(httpMessage4); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: HttpMessage4Handler102738066 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage5Handler1463345875.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage5Handler1463345875.cs deleted file mode 100644 index 6603c853c..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage5Handler1463345875.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: HttpMessage5Handler1463345875 - public class HttpMessage5Handler1463345875 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var httpMessage5 = (WolverineWebApi.HttpMessage5)context.Envelope.Message; - - - // The actual message execution - WolverineWebApi.MessageHandler.Handle(httpMessage5); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: HttpMessage5Handler1463345875 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage6Handler1060061348.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage6Handler1060061348.cs deleted file mode 100644 index a0691dd38..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/HttpMessage6Handler1060061348.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: HttpMessage6Handler1060061348 - public class HttpMessage6Handler1060061348 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var httpMessage6 = (WolverineWebApi.HttpMessage6)context.Envelope.Message; - - - // The actual message execution - WolverineWebApi.MessageHandler.Handle(httpMessage6); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: HttpMessage6Handler1060061348 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/IncrementCountHandler1900628703.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/IncrementCountHandler1900628703.cs deleted file mode 100644 index 986fbf029..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/IncrementCountHandler1900628703.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -#pragma warning disable -using WolverineWebApi.WebSockets; - -namespace Internal.Generated.WolverineHandlers -{ - // START: IncrementCountHandler1900628703 - public class IncrementCountHandler1900628703 : Wolverine.Runtime.Handlers.MessageHandler - { - private readonly WolverineWebApi.WebSockets.Broadcaster _broadcaster; - - public IncrementCountHandler1900628703(WolverineWebApi.WebSockets.Broadcaster broadcaster) - { - _broadcaster = broadcaster; - } - - - - public override async System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var incrementCount = (WolverineWebApi.WebSockets.IncrementCount)context.Envelope.Message; - - - // The actual message execution - var outgoing1 = WolverineWebApi.WebSockets.SomeUpdateHandler.Handle(incrementCount); - - await _broadcaster.Post(outgoing1).ConfigureAwait(false); - } - - } - - // END: IncrementCountHandler1900628703 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/ItemCreatedHandler179438836.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/ItemCreatedHandler179438836.cs deleted file mode 100644 index 31d3a15d4..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/ItemCreatedHandler179438836.cs +++ /dev/null @@ -1,30 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: ItemCreatedHandler179438836 - public class ItemCreatedHandler179438836 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - var itemCreatedHandler = new WolverineWebApi.ItemCreatedHandler(); - // The actual message body - var itemCreated = (WolverineWebApi.ItemCreated)context.Envelope.Message; - - - // The actual message execution - itemCreatedHandler.Handle(itemCreated); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: ItemCreatedHandler179438836 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_auditable_empty.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_auditable_empty.cs deleted file mode 100644 index 68dcd1e25..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_auditable_empty.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_auditable_empty - public class POST_auditable_empty : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_auditable_empty(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var auditableEndpoint = new WolverineWebApi.AuditableEndpoint(); - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - // Application-specific Open Telemetry auditing - System.Diagnostics.Activity.Current?.SetTag("id", command.Id); - - // The actual HTTP request handler execution - auditableEndpoint.EmptyPost(command); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_auditable_empty - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_auditable_post.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_auditable_post.cs deleted file mode 100644 index ac8a9d185..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_auditable_post.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_auditable_post - public class POST_auditable_post : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_auditable_post(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - var auditableEndpoint = new WolverineWebApi.AuditableEndpoint(); - // Reading the request body via JSON deserialization - var (body, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - // Application-specific Open Telemetry auditing - System.Diagnostics.Activity.Current?.SetTag("id", body.Id); - - // The actual HTTP request handler execution - var result_of_Post = auditableEndpoint.Post(body); - - - // Outgoing, cascaded message - await messageContext.EnqueueCascadingAsync(result_of_Post).ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_auditable_post - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_authenticated.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_authenticated.cs deleted file mode 100644 index d9cc98960..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_authenticated.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_authenticated - public class POST_authenticated : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_authenticated(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var authenticatedEndpoint = new WolverineWebApi.AuthenticatedEndpoint(); - var fakeAuthenticationMiddleware = new WolverineWebApi.FakeAuthenticationMiddleware(); - // Reading the request body via JSON deserialization - var (request, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - var result1 = WolverineWebApi.FakeAuthenticationMiddleware.Before(request); - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var result_of_Get = authenticatedEndpoint.Get(request); - - await WriteString(httpContext, result_of_Get); - } - - } - - // END: POST_authenticated - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_convert_book.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_convert_book.cs deleted file mode 100644 index 97d418220..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_convert_book.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_convert_book - public class POST_convert_book : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_convert_book(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - // Reading the request body via JSON deserialization - var (@event, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - await WolverineWebApi.Bugs.ConvertBookEndpoint.Post(@event, messageContext, httpContext.RequestAborted).ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_convert_book - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_create.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_create.cs deleted file mode 100644 index 6876d8b33..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_create.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using Microsoft.EntityFrameworkCore; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_ef_create - public class POST_ef_create : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - private readonly Microsoft.EntityFrameworkCore.DbContextOptions _dbContextOptions; - - public POST_ef_create(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Microsoft.EntityFrameworkCore.DbContextOptions dbContextOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _dbContextOptions = dbContextOptions; - } - - - - 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); - - // Enroll the DbContext & IMessagingContext in the outgoing Wolverine outbox transaction - var envelopeTransaction = Wolverine.EntityFrameworkCore.WolverineEntityCoreExtensions.BuildTransaction(itemsDbContext, messageContext); - await messageContext.EnlistInOutboxAsync(envelopeTransaction); - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - efCoreEndpoints.CreateItem(command, itemsDbContext); - - - // Added by EF Core Transaction Middleware - var result_of_SaveChangesAsync = await itemsDbContext.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - // If we have separate context for outbox and application, then we need to manually commit the transaction - if (envelopeTransaction is Wolverine.EntityFrameworkCore.Internals.RawDatabaseEnvelopeTransaction rawTx) { await rawTx.CommitAsync(); } - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_ef_create - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_publish.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_publish.cs deleted file mode 100644 index 4f771375d..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_ef_publish.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using Microsoft.EntityFrameworkCore; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_ef_publish - public class POST_ef_publish : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - private readonly Microsoft.EntityFrameworkCore.DbContextOptions _dbContextOptions; - - public POST_ef_publish(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Microsoft.EntityFrameworkCore.DbContextOptions dbContextOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _dbContextOptions = dbContextOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var efCoreEndpoints = new WolverineWebApi.EfCoreEndpoints(); - await using var itemsDbContext = new WolverineWebApi.ItemsDbContext(_dbContextOptions); - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - - // Enroll the DbContext & IMessagingContext in the outgoing Wolverine outbox transaction - var envelopeTransaction = Wolverine.EntityFrameworkCore.WolverineEntityCoreExtensions.BuildTransaction(itemsDbContext, messageContext); - await messageContext.EnlistInOutboxAsync(envelopeTransaction); - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - await efCoreEndpoints.PublishItem(command, itemsDbContext, messageContext).ConfigureAwait(false); - - - // Added by EF Core Transaction Middleware - var result_of_SaveChangesAsync = await itemsDbContext.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - // If we have separate context for outbox and application, then we need to manually commit the transaction - if (envelopeTransaction is Wolverine.EntityFrameworkCore.Internals.RawDatabaseEnvelopeTransaction rawTx) { await rawTx.CommitAsync(); } - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_ef_publish - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_fromservices.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_fromservices.cs deleted file mode 100644 index 2c8e7e3bb..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_fromservices.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using WolverineWebApi; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_fromservices - public class POST_fromservices : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly WolverineWebApi.Recorder _recorder; - - public POST_fromservices(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, WolverineWebApi.Recorder recorder) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _recorder = recorder; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var attributeEndpoints = new WolverineWebApi.AttributeEndpoints(); - - // The actual HTTP request handler execution - var result_of_PostFromServices = attributeEndpoints.PostFromServices(_recorder); - - await WriteString(httpContext, result_of_PostFromServices); - } - - } - - // END: POST_fromservices - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go.cs deleted file mode 100644 index 6cc142937..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_go - public class POST_go : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_go(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - fakeEndpoint.Go(); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: POST_go - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go_async.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go_async.cs deleted file mode 100644 index 3cf14b3be..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go_async.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_go_async - public class POST_go_async : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_go_async(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - await fakeEndpoint.GoAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_go_async - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go_async2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go_async2.cs deleted file mode 100644 index db97bcb50..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_go_async2.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_go_async2 - public class POST_go_async2 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_go_async2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var fakeEndpoint = new WolverineWebApi.FakeEndpoint(); - - // The actual HTTP request handler execution - await fakeEndpoint.GoAsync2(); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_go_async2 - - -} - 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 deleted file mode 100644 index 391593ec4..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_invoiceId_pay.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_invoices_invoiceId_pay - 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; - - public POST_invoices_invoiceId_pay(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - if (!System.Guid.TryParse((string)httpContext.GetRouteValue("invoiceId"), out var invoiceId)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - 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 - var martenOp = WolverineWebApi.Marten.InvoicesEndpoint.Pay(invoice); - - - // Placed by Wolverine's ISideEffect policy - martenOp.Execute(documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_invoices_invoiceId_pay - - -} - 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 deleted file mode 100644 index d8173ca39..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_invoices_number_approve.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_invoices_number_approve - 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; - - public POST_invoices_number_approve(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - if (!System.Guid.TryParse((string)httpContext.GetRouteValue("number"), out var number)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - var invoice = await documentSession.LoadAsync(number, httpContext.RequestAborted).ConfigureAwait(false); - - // The actual HTTP request handler execution - var martenOp = WolverineWebApi.Marten.InvoicesEndpoint.Approve(invoice); - - - // Placed by Wolverine's ISideEffect policy - martenOp.Execute(documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_invoices_number_approve - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_issue.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_issue.cs deleted file mode 100644 index bb77f1f86..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_issue.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_issue - 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; - - public POST_issue(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - var createEndpoint = new WolverineWebApi.CreateEndpoint(); - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - (var issueCreated_response, var insertDoc) = createEndpoint.Create(command); - - - // Placed by Wolverine's ISideEffect policy - insertDoc.Execute(documentSession); - - // This response type customizes the HTTP response - ApplyHttpAware(issueCreated_response, httpContext); - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, issueCreated_response); - } - - } - - // END: POST_issue - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_notbody.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_notbody.cs deleted file mode 100644 index 7c7631bc0..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_notbody.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using WolverineWebApi; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_notbody - public class POST_notbody : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly WolverineWebApi.Recorder _recorder; - - public POST_notbody(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, WolverineWebApi.Recorder recorder) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _recorder = recorder; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var attributeEndpoints = new WolverineWebApi.AttributeEndpoints(); - - // The actual HTTP request handler execution - var result_of_PostNotBody = attributeEndpoints.PostNotBody(_recorder); - - await WriteString(httpContext, result_of_PostNotBody); - } - - } - - // END: POST_notbody - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create.cs deleted file mode 100644 index 5596555a8..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_create - 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; - - public POST_orders_create(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var orderStatus_response = WolverineWebApi.Marten.MarkItemEndpoint.StartOrder(command, documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, orderStatus_response); - } - - } - - // END: POST_orders_create - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create2.cs deleted file mode 100644 index 11915b832..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create2.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_create2 - 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; - - public POST_orders_create2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - // Catches any existing stream id collision exceptions - try - { - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - (var orderStatus_response, var startStream) = WolverineWebApi.Marten.MarkItemEndpoint.StartOrder2(command, documentSession); - - - // Placed by Wolverine's ISideEffect policy - startStream.Execute(documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, orderStatus_response); - } - - - catch(Marten.Exceptions.ExistingStreamIdCollisionException e) - { - await WolverineWebApi.Marten.StreamCollisionExceptionPolicy.RespondWithProblemDetails(e, httpContext); - return; - } - - - } - - } - - // END: POST_orders_create2 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create3.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create3.cs deleted file mode 100644 index eed22f4c8..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create3.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_create3 - 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; - - public POST_orders_create3(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - // Catches any existing stream id collision exceptions - try - { - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - (var creationResponse_response, var startStream) = WolverineWebApi.Marten.MarkItemEndpoint.StartOrder3(command); - - - // Placed by Wolverine's ISideEffect policy - startStream.Execute(documentSession); - - // This response type customizes the HTTP response - ApplyHttpAware(creationResponse_response, httpContext); - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, creationResponse_response); - } - - - catch(Marten.Exceptions.ExistingStreamIdCollisionException e) - { - await WolverineWebApi.Marten.StreamCollisionExceptionPolicy.RespondWithProblemDetails(e, httpContext); - return; - } - - - } - - } - - // END: POST_orders_create3 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create4.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create4.cs deleted file mode 100644 index a8211aaf3..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_create4.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_create4 - 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; - - public POST_orders_create4(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - // Catches any existing stream id collision exceptions - try - { - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - (var orderStatus_response, var startStream) = WolverineWebApi.Marten.MarkItemEndpoint.StartOrder4(command); - - - // Placed by Wolverine's ISideEffect policy - startStream.Execute(documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, orderStatus_response); - } - - - catch(Marten.Exceptions.ExistingStreamIdCollisionException e) - { - await WolverineWebApi.Marten.StreamCollisionExceptionPolicy.RespondWithProblemDetails(e, httpContext); - return; - } - - - } - - } - - // END: POST_orders_create4 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_itemready.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_itemready.cs deleted file mode 100644 index fa79d0b2c..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_itemready.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_itemready - 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; - - public POST_orders_itemready(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - 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; - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - var eventStore = documentSession.Events; - - // Loading Marten aggregate - var eventStream = await eventStore.FetchForWriting(command.OrderId, command.Version, httpContext.RequestAborted).ConfigureAwait(false); - - - // The actual HTTP request handler execution - (var orderStatus_response, var events) = WolverineWebApi.Marten.MarkItemEndpoint.Post(command, eventStream.Aggregate); - - if (events != null) - { - - // Capturing any possible events returned from the command handlers - eventStream.AppendMany(events); - - } - - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, orderStatus_response); - } - - } - - // END: POST_orders_itemready - - -} - 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 deleted file mode 100644 index 1089d9d72..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship2.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_orderId_ship2 - 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; - - public POST_orders_orderId_ship2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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; - return; - } - - - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - var eventStore = documentSession.Events; - - // Loading Marten aggregate - var eventStream = await eventStore.FetchForWriting(orderId, httpContext.RequestAborted).ConfigureAwait(false); - - var result1 = Wolverine.Http.Marten.AggregateAttribute.ValidateAggregateExists(eventStream); - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var orderShipped = WolverineWebApi.Marten.MarkItemEndpoint.Ship(command, eventStream.Aggregate); - - eventStream.AppendOne(orderShipped); - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_orders_orderId_ship2 - - -} - 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 deleted file mode 100644 index ee30405fc..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship3.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_orderId_ship3 - 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; - - public POST_orders_orderId_ship3(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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; - return; - } - - - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - var eventStore = documentSession.Events; - - // Loading Marten aggregate - var eventStream = await eventStore.FetchForWriting(orderId, httpContext.RequestAborted).ConfigureAwait(false); - - var result1 = Wolverine.Http.Marten.AggregateAttribute.ValidateAggregateExists(eventStream); - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var orderShipped = WolverineWebApi.Marten.MarkItemEndpoint.Ship3(eventStream.Aggregate); - - eventStream.AppendOne(orderShipped); - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_orders_orderId_ship3 - - -} - 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 deleted file mode 100644 index fc718ef29..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_orderId_ship4.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_orderId_ship4 - 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; - - public POST_orders_orderId_ship4(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - if (!System.Guid.TryParse((string)httpContext.GetRouteValue("orderId"), out var orderId)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - var eventStore = documentSession.Events; - - // Loading Marten aggregate - var eventStream = await eventStore.FetchForWriting(orderId, httpContext.RequestAborted).ConfigureAwait(false); - - var result1 = Wolverine.Http.Marten.AggregateAttribute.ValidateAggregateExists(eventStream); - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var orderShipped = WolverineWebApi.Marten.MarkItemEndpoint.Ship4(eventStream.Aggregate); - - eventStream.AppendOne(orderShipped); - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_orders_orderId_ship4 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_ship.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_ship.cs deleted file mode 100644 index 6c8361dd8..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_orders_ship.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_orders_ship - 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; - - public POST_orders_ship(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - 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; - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - var eventStore = documentSession.Events; - - // Loading Marten aggregate - var eventStream = await eventStore.FetchForWriting(command.OrderId, httpContext.RequestAborted).ConfigureAwait(false); - - - // The actual HTTP request handler execution - var orderShipped = WolverineWebApi.Marten.MarkItemEndpoint.Ship(command, eventStream.Aggregate); - - eventStream.AppendOne(orderShipped); - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_orders_ship - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_problems.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_problems.cs deleted file mode 100644 index 1d1bf9ec6..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_problems.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_problems - public class POST_problems : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_problems(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var problemDetailsUsageEndpoint = new WolverineWebApi.ProblemDetailsUsageEndpoint(); - // Reading the request body via JSON deserialization - var (message, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - var problemDetails = problemDetailsUsageEndpoint.Before(message); - // Evaluate whether the processing should stop if there are any problems - if (!(ReferenceEquals(problemDetails, Wolverine.Http.WolverineContinue.NoProblems))) - { - await WriteProblems(problemDetails, httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var result_of_Post = WolverineWebApi.ProblemDetailsUsageEndpoint.Post(message); - - await WriteString(httpContext, result_of_Post); - } - - } - - // END: POST_problems - - -} - 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 deleted file mode 100644 index e34c31837..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_marten_message.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_publish_marten_message - 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; - - public POST_publish_marten_message(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var serviceEndpoints = new WolverineWebApi.ServiceEndpoints(); - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - // Reading the request body via JSON deserialization - var (data, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - await serviceEndpoints.PublishData(data, messageContext, documentSession).ConfigureAwait(false); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_publish_marten_message - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_message1.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_message1.cs deleted file mode 100644 index a5a1026fb..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_message1.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_publish_message1 - public class POST_publish_message1 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_publish_message1(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var publishingEndpoint = new Wolverine.Http.Runtime.PublishingEndpoint(); - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - // Reading the request body via JSON deserialization - var (message, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var result_of_PublishAsync = await publishingEndpoint.PublishAsync(message, messageContext, httpContext.Response); - - await WriteString(httpContext, result_of_PublishAsync); - } - - } - - // END: POST_publish_message1 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_message2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_message2.cs deleted file mode 100644 index daa184bc8..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_publish_message2.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_publish_message2 - public class POST_publish_message2 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_publish_message2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var publishingEndpoint = new Wolverine.Http.Runtime.PublishingEndpoint(); - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - // Reading the request body via JSON deserialization - var (message, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var result_of_PublishAsync = await publishingEndpoint.PublishAsync(message, messageContext, httpContext.Response); - - await WriteString(httpContext, result_of_PublishAsync); - } - - } - - // END: POST_publish_message2 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_question.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_question.cs deleted file mode 100644 index 0acd72261..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_question.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_question - public class POST_question : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_question(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Reading the request body via JSON deserialization - var (question, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var arithmeticResults_response = WolverineWebApi.TestEndpoints.PostJson(question); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, arithmeticResults_response); - } - - } - - // END: POST_question - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_question2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_question2.cs deleted file mode 100644 index 998ef38aa..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_question2.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_question2 - public class POST_question2 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_question2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Reading the request body via JSON deserialization - var (question, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - // Just saying hello in the code! Also testing the usage of attributes to customize endpoints - - // The actual HTTP request handler execution - var arithmeticResults_response = await WolverineWebApi.TestEndpoints.PostJsonAsync(question).ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, arithmeticResults_response); - } - - } - - // END: POST_question2 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation.cs deleted file mode 100644 index 22ff1cbbd..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_reservation - 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; - - public POST_reservation(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - // Reading the request body via JSON deserialization - var (start, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - (var reservationBooked_response, var reservation, var reservationTimeout) = WolverineWebApi.ReservationEndpoint.Post(start); - - - // Register the document operation with the current session - documentSession.Insert(reservation); - - // Outgoing, cascaded message - await messageContext.EnqueueCascadingAsync(reservationTimeout).ConfigureAwait(false); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, reservationBooked_response); - } - - } - - // END: POST_reservation - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation2.cs deleted file mode 100644 index c0f612daf..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_reservation2.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_reservation2 - 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; - - public POST_reservation2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - // Reading the request body via JSON deserialization - var (start, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var reservation = WolverineWebApi.ReservationEndpoint.Post2(start); - - - // Register the document operation with the current session - documentSession.Insert(reservation); - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_reservation2 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_send_message5.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_send_message5.cs deleted file mode 100644 index fa0b43e27..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_send_message5.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_send_message5 - public class POST_send_message5 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_send_message5(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var sendingEndpoint = new Wolverine.Http.Runtime.SendingEndpoint(); - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - // Reading the request body via JSON deserialization - var (message, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var result_of_SendAsync = await sendingEndpoint.SendAsync(message, messageContext, httpContext.Response); - - await WriteString(httpContext, result_of_SendAsync); - } - - } - - // END: POST_send_message5 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_send_message6.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_send_message6.cs deleted file mode 100644 index 5eb1c51e2..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_send_message6.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_send_message6 - public class POST_send_message6 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_send_message6(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var sendingEndpoint = new Wolverine.Http.Runtime.SendingEndpoint(); - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - // Reading the request body via JSON deserialization - var (message, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var result_of_SendAsync = await sendingEndpoint.SendAsync(message, messageContext, httpContext.Response); - - await WriteString(httpContext, result_of_SendAsync); - } - - } - - // END: POST_send_message6 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_some_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_some_id.cs deleted file mode 100644 index ef85a159c..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_some_id.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_some_id - 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; - - public POST_some_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var id = (string)httpContext.GetRouteValue("id"); - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(messageContext); - // Reading the request body via JSON deserialization - var (request, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - var someDocument = await WolverineWebApi.Bugs.SomeEndpoint.LoadAsync(id, documentSession).ConfigureAwait(false); - // 404 if this required object is null - if (someDocument == null) - { - httpContext.Response.StatusCode = 404; - return; - } - - - // The actual HTTP request handler execution - var storeDoc = WolverineWebApi.Bugs.SomeEndpoint.Handle(request, someDocument); - - - // Placed by Wolverine's ISideEffect policy - storeDoc.Execute(documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_some_id - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn.cs deleted file mode 100644 index ec6788fb8..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_spawn - public class POST_spawn : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_spawn(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - // Reading the request body via JSON deserialization - var (input, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - (var stringValue, var outgoingMessages) = WolverineWebApi.MessageSpawnerEndpoint.Post(input); - - - // Outgoing, cascaded message - await messageContext.EnqueueCascadingAsync(outgoingMessages).ConfigureAwait(false); - - await WriteString(httpContext, stringValue); - } - - } - - // END: POST_spawn - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn2.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn2.cs deleted file mode 100644 index 5d27caac8..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn2.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_spawn2 - public class POST_spawn2 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_spawn2(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - - // The actual HTTP request handler execution - (var httpMessage1, var httpMessage2) = WolverineWebApi.MessageSpawnerEndpoint.Post(); - - - // Outgoing, cascaded message - await messageContext.EnqueueCascadingAsync(httpMessage1).ConfigureAwait(false); - - - // Outgoing, cascaded message - await messageContext.EnqueueCascadingAsync(httpMessage2).ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_spawn2 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn3.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn3.cs deleted file mode 100644 index c28c9260b..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_spawn3.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_spawn3 - public class POST_spawn3 : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime; - - public POST_spawn3(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime); - Wolverine.Http.Runtime.RequestIdMiddleware.Apply(httpContext, messageContext); - - // The actual HTTP request handler execution - await WolverineWebApi.MessageSpawnerEndpoint.SendViaMessageBus(messageContext); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_spawn3 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_status.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_status.cs deleted file mode 100644 index b7836dbcc..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_status.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using Microsoft.Extensions.Logging; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_status - public class POST_status : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly Microsoft.Extensions.Logging.ILogger _loggerForMessage; - - public POST_status(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Microsoft.Extensions.Logging.ILogger loggerForMessage) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _loggerForMessage = loggerForMessage; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Reading the request body via JSON deserialization - var (request, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var result_of_PostStatusCode = WolverineWebApi.StatusCodeEndpoint.PostStatusCode(request, ((Microsoft.Extensions.Logging.ILogger)_loggerForMessage)); - - httpContext.Response.StatusCode = result_of_PostStatusCode; - } - - } - - // END: POST_status - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_swagger_empty.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_swagger_empty.cs deleted file mode 100644 index 26b911111..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_swagger_empty.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_swagger_empty - 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; - - public POST_swagger_empty(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var martenOp = WolverineWebApi.SwaggerEndpoints.PostEmpty(command); - - - // Placed by Wolverine's ISideEffect policy - martenOp.Execute(documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: POST_swagger_empty - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_todoitems.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_todoitems.cs deleted file mode 100644 index 332f30ef9..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_todoitems.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_todoitems - 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; - - public POST_todoitems(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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); - // Reading the request body via JSON deserialization - var (command, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - (var todoCreationResponse_response, var todoCreated) = WolverineWebApi.Samples.TodoCreationEndpoint.Post(command, documentSession); - - - // Outgoing, cascaded message - await messageContext.EnqueueCascadingAsync(todoCreated).ConfigureAwait(false); - - // This response type customizes the HTTP response - ApplyHttpAware(todoCreationResponse_response, httpContext); - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, todoCreationResponse_response); - } - - } - - // END: POST_todoitems - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_users_sign_up.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_users_sign_up.cs deleted file mode 100644 index 04d4a7814..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_users_sign_up.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_users_sign_up - public class POST_users_sign_up : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - - public POST_users_sign_up(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Reading the request body via JSON deserialization - var (request, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // The actual HTTP request handler execution - var result = WolverineWebApi.SignupEndpoint.SignUp(request); - - await result.ExecuteAsync(httpContext).ConfigureAwait(false); - } - - } - - // END: POST_users_sign_up - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_customer.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_customer.cs deleted file mode 100644 index 6160d4611..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_customer.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -#pragma warning disable -using FluentValidation; -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Http.FluentValidation; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_validate2_customer - 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; - - public POST_validate2_customer(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, FluentValidation.IValidator validator, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _validator = validator; - _problemDetailSource = problemDetailSource; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Reading the request body via JSON deserialization - var (customer, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // Execute FluentValidation validators - var result1 = await Wolverine.Http.FluentValidation.Internals.FluentValidationHttpExecutor.ExecuteOne(_validator, _problemDetailSource, customer).ConfigureAwait(false); - - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var result_of_Post = Wolverine.Http.Tests.DifferentAssembly.Validation.Validated2Endpoint.Post(customer); - - await WriteString(httpContext, result_of_Post); - } - - } - - // END: POST_validate2_customer - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_user.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_user.cs deleted file mode 100644 index 3a2180555..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate2_user.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -#pragma warning disable -using FluentValidation; -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Http.FluentValidation; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_validate2_user - 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 Wolverine.Http.FluentValidation.IProblemDetailSource _problemDetailSource; - - 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) - { - _wolverineHttpOptions = wolverineHttpOptions; - _validator_of_CreateUser2_348930900 = validator_of_CreateUser2_348930900; - _validator_of_CreateUser2_1683673752 = validator_of_CreateUser2_1683673752; - _problemDetailSource = problemDetailSource; - } - - - - 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}; - // Reading the request body via JSON deserialization - var (user, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - var result1 = await Wolverine.Http.FluentValidation.Internals.FluentValidationHttpExecutor.ExecuteMany(validatorList, _problemDetailSource, user).ConfigureAwait(false); - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var result_of_Post = Wolverine.Http.Tests.DifferentAssembly.Validation.Validated2Endpoint.Post(user); - - await WriteString(httpContext, result_of_Post); - } - - } - - // END: POST_validate2_user - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_customer.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_customer.cs deleted file mode 100644 index 8b611eb38..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_customer.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -#pragma warning disable -using FluentValidation; -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Http.FluentValidation; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_validate_customer - 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; - - public POST_validate_customer(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, FluentValidation.IValidator validator, Wolverine.Http.FluentValidation.IProblemDetailSource problemDetailSource) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _validator = validator; - _problemDetailSource = problemDetailSource; - } - - - - public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext) - { - // Reading the request body via JSON deserialization - var (customer, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - - // Execute FluentValidation validators - var result1 = await Wolverine.Http.FluentValidation.Internals.FluentValidationHttpExecutor.ExecuteOne(_validator, _problemDetailSource, customer).ConfigureAwait(false); - - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var result_of_Post = WolverineWebApi.Validation.ValidatedEndpoint.Post(customer); - - await WriteString(httpContext, result_of_Post); - } - - } - - // END: POST_validate_customer - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_user.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_user.cs deleted file mode 100644 index 5b2d78850..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/POST_validate_user.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -#pragma warning disable -using FluentValidation; -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Http.FluentValidation; - -namespace Internal.Generated.WolverineHandlers -{ - // START: POST_validate_user - public class POST_validate_user : Wolverine.Http.HttpHandler - { - private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions; - private readonly FluentValidation.IValidator _validator_of_CreateUser1376587052; - private readonly Wolverine.Http.FluentValidation.IProblemDetailSource _problemDetailSource; - private readonly FluentValidation.IValidator _validator_of_CreateUser580623592; - - 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) - { - _wolverineHttpOptions = wolverineHttpOptions; - _validator_of_CreateUser1376587052 = validator_of_CreateUser1376587052; - _problemDetailSource = problemDetailSource; - _validator_of_CreateUser580623592 = validator_of_CreateUser580623592; - } - - - - 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}; - // Reading the request body via JSON deserialization - var (user, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - var result1 = await Wolverine.Http.FluentValidation.Internals.FluentValidationHttpExecutor.ExecuteMany(validatorList, _problemDetailSource, user).ConfigureAwait(false); - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var result_of_Post = WolverineWebApi.Validation.ValidatedEndpoint.Post(user); - - await WriteString(httpContext, result_of_Post); - } - - } - - // END: POST_validate_user - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos2_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos2_id.cs deleted file mode 100644 index e661a2c52..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos2_id.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: PUT_todos2_id - 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; - - public PUT_todos2_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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 (!int.TryParse((string)httpContext.GetRouteValue("id"), out var id)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - // Reading the request body via JSON deserialization - var (request, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - (var todo, var result1) = await WolverineWebApi.Samples.Update2Endpoint.LoadAsync(id, request, documentSession).ConfigureAwait(false); - // Evaluate whether or not the execution should be stopped based on the IResult value - if (!(result1 is Wolverine.Http.WolverineContinue)) - { - await result1.ExecuteAsync(httpContext).ConfigureAwait(false); - return; - } - - - - // The actual HTTP request handler execution - var todo_response = WolverineWebApi.Samples.Update2Endpoint.Put(id, request, todo, documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Writing the response body to JSON because this was the first 'return variable' in the method signature - await WriteJsonAsync(httpContext, todo_response); - } - - } - - // END: PUT_todos2_id - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos_id.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos_id.cs deleted file mode 100644 index 2cfe3ace7..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/PUT_todos_id.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -#pragma warning disable -using Microsoft.AspNetCore.Routing; -using System; -using System.Linq; -using Wolverine.Http; -using Wolverine.Marten.Publishing; -using Wolverine.Runtime; - -namespace Internal.Generated.WolverineHandlers -{ - // START: PUT_todos_id - 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; - - public PUT_todos_id(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) : base(wolverineHttpOptions) - { - _wolverineHttpOptions = wolverineHttpOptions; - _wolverineRuntime = wolverineRuntime; - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - 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 (!int.TryParse((string)httpContext.GetRouteValue("id"), out var id)) - { - httpContext.Response.StatusCode = 404; - return; - } - - - // Reading the request body via JSON deserialization - var (request, jsonContinue) = await ReadJsonAsync(httpContext); - if (jsonContinue == Wolverine.HandlerContinuation.Stop) return; - var todo = await WolverineWebApi.Samples.UpdateEndpoint.LoadAsync(id, documentSession).ConfigureAwait(false); - // 404 if this required object is null - if (todo == null) - { - httpContext.Response.StatusCode = 404; - return; - } - - - // The actual HTTP request handler execution - var storeDoc = WolverineWebApi.Samples.UpdateEndpoint.Put(id, request, todo); - - - // Placed by Wolverine's ISideEffect policy - storeDoc.Execute(documentSession); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(httpContext.RequestAborted).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await messageContext.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - // Wolverine automatically sets the status code to 204 for empty responses - if (!httpContext.Response.HasStarted) httpContext.Response.StatusCode = 204; - } - - } - - // END: PUT_todos_id - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/ReservationTimeoutHandler457905910.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/ReservationTimeoutHandler457905910.cs deleted file mode 100644 index 1984a7a7b..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/ReservationTimeoutHandler457905910.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -#pragma warning disable -using Microsoft.Extensions.Logging; -using Wolverine.Marten.Publishing; - -namespace Internal.Generated.WolverineHandlers -{ - // START: ReservationTimeoutHandler457905910 - public class ReservationTimeoutHandler457905910 : Wolverine.Runtime.Handlers.MessageHandler - { - private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; - private readonly Microsoft.Extensions.Logging.ILogger _logger; - - public ReservationTimeoutHandler457905910(Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, Microsoft.Extensions.Logging.ILogger logger) - { - _outboxedSessionFactory = outboxedSessionFactory; - _logger = logger; - } - - - - public override async System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(context); - // The actual message body - var reservationTimeout = (WolverineWebApi.ReservationTimeout)context.Envelope.Message; - - string sagaId = context.Envelope.SagaId ?? reservationTimeout.Id; - if (string.IsNullOrEmpty(sagaId)) throw new Wolverine.Persistence.Sagas.IndeterminateSagaStateIdException(context.Envelope); - - // Try to load the existing saga document - var reservation = await documentSession.LoadAsync(sagaId, cancellation).ConfigureAwait(false); - if (reservation == null) - { - return; - } - - else - { - - // The actual message execution - reservation.Handle(reservationTimeout, _logger); - - // Delete the saga if completed, otherwise update it - if (reservation.IsCompleted()) - { - - // Register the document operation with the current session - documentSession.Delete(reservation); - } - - else - { - - // Register the document operation with the current session - documentSession.Update(reservation); - } - - - // Commit all pending changes - await documentSession.SaveChangesAsync(cancellation).ConfigureAwait(false); - - } - - } - - } - - // END: ReservationTimeoutHandler457905910 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/StartReservationHandler1747369353.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/StartReservationHandler1747369353.cs deleted file mode 100644 index 379733ac8..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/StartReservationHandler1747369353.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -#pragma warning disable -using Wolverine.Marten.Publishing; - -namespace Internal.Generated.WolverineHandlers -{ - // START: StartReservationHandler1747369353 - public class StartReservationHandler1747369353 : Wolverine.Runtime.Handlers.MessageHandler - { - private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory; - - public StartReservationHandler1747369353(Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory) - { - _outboxedSessionFactory = outboxedSessionFactory; - } - - - - public override async System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // Building the Marten session - await using var documentSession = _outboxedSessionFactory.OpenSession(context); - // The actual message body - var startReservation = (WolverineWebApi.StartReservation)context.Envelope.Message; - - - // The actual message execution - (var outgoing1, var outgoing2, var outgoing3) = WolverineWebApi.StartReservationHandler.Handle(startReservation); - - - // Outgoing, cascaded message - await context.EnqueueCascadingAsync(outgoing1).ConfigureAwait(false); - - - // Register the document operation with the current session - documentSession.Insert(outgoing2); - - // Outgoing, cascaded message - await context.EnqueueCascadingAsync(outgoing3).ConfigureAwait(false); - - - // Commit any outstanding Marten changes - await documentSession.SaveChangesAsync(cancellation).ConfigureAwait(false); - - - // Have to flush outgoing messages just in case Marten did nothing because of https://github.com/JasperFx/wolverine/issues/536 - await context.FlushOutgoingMessagesAsync().ConfigureAwait(false); - - } - - } - - // END: StartReservationHandler1747369353 - - -} - diff --git a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/TelegramUpdatedHandler96651444.cs b/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/TelegramUpdatedHandler96651444.cs deleted file mode 100644 index 155923aa9..000000000 --- a/src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/TelegramUpdatedHandler96651444.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -#pragma warning disable - -namespace Internal.Generated.WolverineHandlers -{ - // START: TelegramUpdatedHandler96651444 - public class TelegramUpdatedHandler96651444 : Wolverine.Runtime.Handlers.MessageHandler - { - - - public override System.Threading.Tasks.Task HandleAsync(Wolverine.Runtime.MessageContext context, System.Threading.CancellationToken cancellation) - { - // The actual message body - var telegramUpdated = (WolverineWebApi.Bugs.TelegramUpdated)context.Envelope.Message; - - - // The actual message execution - WolverineWebApi.Bugs.TelegramUpdatedHandler.Handle(telegramUpdated); - - return System.Threading.Tasks.Task.CompletedTask; - } - - } - - // END: TelegramUpdatedHandler96651444 - - -} -