-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable ASP.NET integration without needing MVC (#205) * Update various NuGet refs * Drop netstandard2.0 support * Bump to V3 because of breaking changes * Fix all Messages in the Error List (#212)
- Loading branch information
Showing
70 changed files
with
1,827 additions
and
514 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
# DO NOT EDIT THIS FILE | ||
# This file was generated by the pr-autoflow mechanism as a result of executing this action: | ||
# https://github.com/endjin/.github/actions/workflows/deploy_pr_autoflow.yml | ||
# This repository participates in this mechanism due to an entry in this file: | ||
# https://github.com/endjin/.github/blob/b69ff1d66541ae049fb0457c65c719c6d7e9b862/repos/live/corvus-dotnet.yml | ||
|
||
mode: ContinuousDeployment | ||
branches: | ||
master: | ||
regex: ^master|main$ | ||
tag: preview | ||
increment: patch | ||
next-version: "2.1" | ||
dependabot-pr: | ||
regex: ^dependabot | ||
tag: dependabot | ||
source-branches: | ||
- develop | ||
- master | ||
- release | ||
- feature | ||
- support | ||
- hotfix | ||
next-version: "3.0" | ||
|
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
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
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
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
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
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
36 changes: 36 additions & 0 deletions
36
Solutions/Menes.Hosting.AspNetCore/Menes/Hosting/AspNetCore/MenesCatchAllMiddleware.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,36 @@ | ||
// <copyright file="MenesCatchAllMiddleware.cs" company="Endjin Limited"> | ||
// Copyright (c) Endjin Limited. All rights reserved. | ||
// </copyright> | ||
|
||
namespace Menes.Hosting.AspNetCore | ||
{ | ||
using System.Threading.Tasks; | ||
|
||
using Menes.Internal; | ||
|
||
using Microsoft.AspNetCore.Http; | ||
|
||
/// <summary> | ||
/// Middleware that passes all requests on to Menes. This never forwards requests further down the pipeline. | ||
/// </summary> | ||
internal class MenesCatchAllMiddleware : IMiddleware | ||
{ | ||
private static readonly object EmptyParameters = new (); | ||
private readonly IOpenApiHost<HttpRequest, IHttpResponseResult> host; | ||
|
||
/// <summary> | ||
/// Creates a <see cref="MenesCatchAllMiddleware"/>. | ||
/// </summary> | ||
/// <param name="host">The Menes host.</param> | ||
public MenesCatchAllMiddleware(IOpenApiHost<HttpRequest, IHttpResponseResult> host) | ||
{ | ||
this.host = host; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public async Task InvokeAsync(HttpContext context, RequestDelegate next) | ||
{ | ||
await this.host.HandleRequestAsync(context, EmptyParameters); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
....Hosting.AspNetCore/Menes/Hosting/AspNetCore/OpenApiAspNetApplicationBuilderExtensions.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,24 @@ | ||
// <copyright file="OpenApiAspNetApplicationBuilderExtensions.cs" company="Endjin Limited"> | ||
// Copyright (c) Endjin Limited. All rights reserved. | ||
// </copyright> | ||
|
||
namespace Menes.Hosting.AspNetCore | ||
{ | ||
using Microsoft.AspNetCore.Builder; | ||
|
||
/// <summary> | ||
/// Extension methods for adding Menes to an ASP.NET Core pipeline. | ||
/// </summary> | ||
public static class OpenApiAspNetApplicationBuilderExtensions | ||
{ | ||
/// <summary> | ||
/// Adds middleware that directs all requests to Menes. | ||
/// </summary> | ||
/// <param name="app">The pipeline builder.</param> | ||
/// <returns>The modified pipeline builder.</returns> | ||
public static IApplicationBuilder UseMenesCatchAll(this IApplicationBuilder app) | ||
{ | ||
return app.UseMiddleware<MenesCatchAllMiddleware>(); | ||
} | ||
} | ||
} |
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
43 changes: 43 additions & 0 deletions
43
.../Menes.Hosting.AspNetCore/Menes/Hosting/AspNetCore/OpenApiHostDirectPipelineExtensions.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,43 @@ | ||
// <copyright file="OpenApiHostDirectPipelineExtensions.cs" company="Endjin Limited"> | ||
// Copyright (c) Endjin Limited. All rights reserved. | ||
// </copyright> | ||
|
||
namespace Menes.Hosting.AspNetCore | ||
{ | ||
using System.Threading.Tasks; | ||
|
||
using Menes.Internal; | ||
|
||
using Microsoft.AspNetCore.Http; | ||
|
||
/// <summary> | ||
/// Extension methods for <see cref="IOpenApiHost{HttpRequest, IHttpResponseResult}"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// <para> | ||
/// Applications typically don't use this directly. Instead, they will normally use | ||
/// <see cref="OpenApiAspNetApplicationBuilderExtensions.UseMenesCatchAll(Microsoft.AspNetCore.Builder.IApplicationBuilder)"/> | ||
/// to Menes middleware that calls this to an ASP.NET Core pipeline. | ||
/// </para> | ||
/// <para> | ||
/// This does not require a dependency on MVC. | ||
/// </para> | ||
/// </remarks> | ||
public static class OpenApiHostDirectPipelineExtensions | ||
{ | ||
/// <summary> | ||
/// Uses the <see cref="IOpenApiHost{HttpRequest, IActionResult}"/> to handle the request. | ||
/// </summary> | ||
/// <param name="host">The host to handle the request.</param> | ||
/// <param name="httpContext">The context for the request to handle.</param> | ||
/// <param name="parameters">Any dynamically constructed parameters sent to the request.</param> | ||
/// <returns>The result of the request.</returns> | ||
public static async Task HandleRequestAsync( | ||
this IOpenApiHost<HttpRequest, IHttpResponseResult> host, HttpContext httpContext, object parameters) | ||
{ | ||
HttpRequest httpRequest = httpContext.Request; | ||
IHttpResponseResult result = await host.HandleRequestAsync(httpRequest.Path, httpRequest.Method, httpRequest, parameters); | ||
await result.ExecuteResultAsync(httpContext.Response); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.