mirror of
https://github.com/AlexMacocian/Net.Sdk.Web.Extensions.git
synced 2026-07-15 13:39:29 +00:00
Setup route map source generator
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
namespace Net.Sdk.Web.Extensions.SourceGenerators.Tests;
|
||||
|
||||
public static class Builder
|
||||
{
|
||||
public static void Build()
|
||||
{
|
||||
EndpointRouteBuilder builder = new EndpointRouteBuilder();
|
||||
builder.MapDeleteSimpleRoute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
namespace Net.Sdk.Web.Extensions.SourceGenerators.Tests;
|
||||
|
||||
public class EndpointRouteBuilder : IEndpointRouteBuilder
|
||||
{
|
||||
public IServiceProvider ServiceProvider { get; }
|
||||
public ICollection<EndpointDataSource> DataSources { get; }
|
||||
|
||||
public IApplicationBuilder CreateApplicationBuilder()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace Net.Sdk.Web.Extensions.SourceGenerators.Tests.Models;
|
||||
|
||||
public class SimpleRequest
|
||||
{
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Library</OutputType>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||
<GenerateMSBuildDebuggingInformation>true</GenerateMSBuildDebuggingInformation>
|
||||
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\Generated</CompilerGeneratedFilesOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
|
||||
<PackageReference Include="Net.Sdk.Web.Extensions.SourceGenerators" Version="0.1.19" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,17 @@
|
||||
using Net.Sdk.Web.Extensions.SourceGenerators.Tests.Models;
|
||||
|
||||
namespace Net.Sdk.Web.Extensions.SourceGenerators.Tests.Routes;
|
||||
|
||||
[GenerateMapDelete(Pattern = "simple")]
|
||||
public sealed class SimpleRoute : IRoute<SimpleRequest>
|
||||
{
|
||||
public Task<Response> HandleRequest(SimpleRequest? request, CancellationToken cancellationToken)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<SimpleRequest?> PreProcess(HttpContext? context, CancellationToken cancellationToken)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user