-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
The current syntax for our Endpoint requests is slightly clunky when mixing Route and Parameter based values, let's use 'AsParameters' to clean this up.
e.g. the following syntax
public record Request(
string Name,
string Alias,
IEnumerable<UpdateHeroPowerDto> Powers) : IRequest<ErrorOr<Guid>>
{
[JsonIgnore]
public Guid HeroId { get; set; }
}could be simplified to
public record Request(
[FromRoute] Guid HeroId,
[FromBody] string Name,
[FromBody] string Alias,
[FromBody] IEnumerable<UpdateHeroPowerDto> Powers) : IRequest<ErrorOr<Guid>>;and then
.MapGet("/{heroId:guid}",
async (Guid id, Request request, ISender sender, CancellationToken cancellationToken) => { ... }could be...
.MapGet("/{heroId:guid}",
async ([AsParameters] Request request, ISender sender, CancellationToken cancellationToken) => { ... }Tasks
- Update the syntax for all endpoints
- Ensure all the endpoint signatures are consistent
Acceptance Criteria
- [AsParameters] used to simplify requests
- Apply this to both the CA and VSA templates
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status