-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add primitive handling to CompiledQuery result writer
- Loading branch information
1 parent
20c6176
commit f1c62cc
Showing
4 changed files
with
123 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/Http/WolverineWebApi/Internal/Generated/WolverineHandlers/GET_invoices_compiled_count.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// <auto-generated/> | ||
#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_compiled_count | ||
public class GET_invoices_compiled_count : 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_compiled_count(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); | ||
|
||
// The actual HTTP request handler execution | ||
var compiledCountQuery = WolverineWebApi.Marten.InvoicesEndpoint.GetCompiledCount(); | ||
|
||
var result_of_QueryAsync = await documentSession.QueryAsync<WolverineWebApi.Marten.Invoice, int>(compiledCountQuery, httpContext.RequestAborted).ConfigureAwait(false); | ||
await Wolverine.Http.HttpHandler.WriteString(httpContext, result_of_QueryAsync.ToString()).ConfigureAwait(false); | ||
} | ||
|
||
} | ||
|
||
// END: GET_invoices_compiled_count | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters