Created
June 30, 2023 09:31
-
-
Save kpietraszko/68792419a62bf2bdb90d58a232268e29 to your computer and use it in GitHub Desktop.
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
public class SomeApiGroup : IEndpointsGroup<SomeApiGroup.Dependencies> | |
{ | |
public record Dependencies( | |
ILogger Logger, | |
ProductsApplicationService service); | |
internal static RouteGroupBuilder MapEndpoints(this WebApplication app) | |
{ | |
var group = app.MapGroup("/products"); | |
group.MapGet("/{publicId}", (Guid publicId, SomeApiGroup.Dependencies dependencies) => | |
{ | |
return Ok(new TestResponse(dependencies.service.Something())); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment