marcominerva / minimalhelpers Goto Github PK
View Code? Open in Web Editor NEWA collection of helpers libraries for Minimal API projects.
License: MIT License
A collection of helpers libraries for Minimal API projects.
License: MIT License
SimpleAuthentication project must support Source Link, as described here: https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link.
At https://github.com/ErikEJ/SqlClientExtensions/blob/main/src/SqlClientExtensions/SqlClientExtensions.csproj you can find a real example of a library with Source Link enabled.
Currently endpoints registration relies on Reflection. In order to support Native AOT scenarios, this approach should be replaced by a solution that uses Source Generator.
With the relase of .NET 7.0, the library should explicitly target both 6.0 and 7.0 versions. The .NET 7.0 must use static abstract interface members.
Sorry if title feel harsh but how can i use source gen version if it reference Microsoft.CodeAnalysis.CSharp 4.9.2
while every tooling in newest Asp.Net core reference 4.5, is this lib suppose to use with preview version of .NET or we suppose to force reference 4.9.2 ??
Now that .NET 7.0.3 includes the fix for dotnet/aspnetcore#45365, the workaround included in the MinimalHelpers.OpenApi library can be removed.
When using WithOpenApi
extension method, IFormFile
and IFormFileCollection
parameters are incorrectly defined in the swagger.json file. The issue is reported here: domaindrivendev/Swashbuckle.AspNetCore#2625.
While waiting for an official fix, it is necessary to provide a workaround for this behavior.
Currently, the library requires that we implement the IEndpointRouteHandler interface and, at runtime, reflection is used to instantiate the class in order to call the MapEndpoints
method. With .NET 7.0, we can provide an alternative method to endpoint registration using static abstract interface members. The proposal is to add the following interface and the corresponding extension method to the library:
public interface IStaticEndpointRouteHandler
{
static abstract void MapEndpoints(IEndpointRouteBuilder endpoints);
}
public static void MapEndpoints<T>(this IEndpointRouteBuilder endpoints) where T : IStaticEndpointRouteHandler
{
// ...
}
In this way, we can register our handler using a syntax like this:
app.MapEndpoints<PeopleHandler>();
app.MapEndpoints<ProductsHandler>();
And no reflection at all will be involved in the registration process.
The question is: giving this new behavior, do you think that IStaticEndpointRouteHandler
is a good name for the new interface?
The library must work with both .NET 6.0 and .NET 7.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.