Style: C# 12 Primary constructor
This commit is contained in:
@@ -9,8 +9,8 @@ public class JoinUs : EndpointGroupBase
|
||||
app.MapGroup(this)
|
||||
.MapPost(CreateFutureCreator);
|
||||
}
|
||||
|
||||
public Task<int> CreateFutureCreator(ISender sender, CreateFutureCreatorCommand command)
|
||||
|
||||
private static Task<int> CreateFutureCreator(ISender sender, CreateFutureCreatorCommand command)
|
||||
{
|
||||
return sender.Send(command);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ public class Stripe : EndpointGroupBase
|
||||
.MapPost(CreateSessionCheckout);
|
||||
}
|
||||
|
||||
public Task<string> CreateSessionCheckout(ISender sender, CreateSessionCheckoutCommand command)
|
||||
private static Task<string> CreateSessionCheckout(ISender sender, CreateSessionCheckoutCommand command)
|
||||
{
|
||||
return sender.Send(command);
|
||||
}
|
||||
|
||||
@@ -20,31 +20,31 @@ public class TodoItems : EndpointGroupBase
|
||||
.MapDelete(DeleteTodoItem, "{id}");
|
||||
}
|
||||
|
||||
public Task<PaginatedList<TodoItemBriefDto>> GetTodoItemsWithPagination(ISender sender, [AsParameters] GetTodoItemsWithPaginationQuery query)
|
||||
private static Task<PaginatedList<TodoItemBriefDto>> GetTodoItemsWithPagination(ISender sender, [AsParameters] GetTodoItemsWithPaginationQuery query)
|
||||
{
|
||||
return sender.Send(query);
|
||||
}
|
||||
|
||||
public Task<int> CreateTodoItem(ISender sender, CreateTodoItemCommand command)
|
||||
private static Task<int> CreateTodoItem(ISender sender, CreateTodoItemCommand command)
|
||||
{
|
||||
return sender.Send(command);
|
||||
}
|
||||
|
||||
public async Task<IResult> UpdateTodoItem(ISender sender, int id, UpdateTodoItemCommand command)
|
||||
private static async Task<IResult> UpdateTodoItem(ISender sender, int id, UpdateTodoItemCommand command)
|
||||
{
|
||||
if (id != command.Id) return Results.BadRequest();
|
||||
await sender.Send(command);
|
||||
return Results.NoContent();
|
||||
}
|
||||
|
||||
public async Task<IResult> UpdateTodoItemDetail(ISender sender, int id, UpdateTodoItemDetailCommand command)
|
||||
private static async Task<IResult> UpdateTodoItemDetail(ISender sender, int id, UpdateTodoItemDetailCommand command)
|
||||
{
|
||||
if (id != command.Id) return Results.BadRequest();
|
||||
await sender.Send(command);
|
||||
return Results.NoContent();
|
||||
}
|
||||
|
||||
public async Task<IResult> DeleteTodoItem(ISender sender, int id)
|
||||
private static async Task<IResult> DeleteTodoItem(ISender sender, int id)
|
||||
{
|
||||
await sender.Send(new DeleteTodoItemCommand(id));
|
||||
return Results.NoContent();
|
||||
|
||||
@@ -17,24 +17,24 @@ public class TodoLists : EndpointGroupBase
|
||||
.MapDelete(DeleteTodoList, "{id}");
|
||||
}
|
||||
|
||||
public Task<TodosVm> GetTodoLists(ISender sender)
|
||||
private static Task<TodosVm> GetTodoLists(ISender sender)
|
||||
{
|
||||
return sender.Send(new GetTodosQuery());
|
||||
return sender.Send(new GetTodosQuery());
|
||||
}
|
||||
|
||||
public Task<int> CreateTodoList(ISender sender, CreateTodoListCommand command)
|
||||
private static Task<int> CreateTodoList(ISender sender, CreateTodoListCommand command)
|
||||
{
|
||||
return sender.Send(command);
|
||||
}
|
||||
|
||||
public async Task<IResult> UpdateTodoList(ISender sender, int id, UpdateTodoListCommand command)
|
||||
private static async Task<IResult> UpdateTodoList(ISender sender, int id, UpdateTodoListCommand command)
|
||||
{
|
||||
if (id != command.Id) return Results.BadRequest();
|
||||
await sender.Send(command);
|
||||
return Results.NoContent();
|
||||
}
|
||||
|
||||
public async Task<IResult> DeleteTodoList(ISender sender, int id)
|
||||
private static async Task<IResult> DeleteTodoList(ISender sender, int id)
|
||||
{
|
||||
await sender.Send(new DeleteTodoListCommand(id));
|
||||
return Results.NoContent();
|
||||
|
||||
@@ -11,7 +11,7 @@ public class WeatherForecasts : EndpointGroupBase
|
||||
.MapGet(GetWeatherForecasts);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WeatherForecast>> GetWeatherForecasts(ISender sender)
|
||||
private static async Task<IEnumerable<WeatherForecast>> GetWeatherForecasts(ISender sender)
|
||||
{
|
||||
return await sender.Send(new GetWeatherForecastsQuery());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user