chore: add .editorconfig and consistent formatting for backend projects

Adds an `.editorconfig` file with C# and project-specific conventions. Applies consistent indentation and formatting across backend handlers, runtime models, and AI services.
This commit is contained in:
2026-03-24 02:55:15 -04:00
parent cfee1306de
commit 766fef1c8f
61 changed files with 17787 additions and 17733 deletions

View File

@@ -4,29 +4,29 @@ namespace SpaceGame.Api.PlayerFaction.Api;
public sealed class CreatePlayerOrganizationHandler(WorldService worldService) : Endpoint<PlayerOrganizationCommandRequest, PlayerFactionSnapshot>
{
public override void Configure()
{
Post("/api/player-faction/organizations");
AllowAnonymous();
}
public override async Task HandleAsync(PlayerOrganizationCommandRequest request, CancellationToken cancellationToken)
{
try
public override void Configure()
{
var snapshot = worldService.CreatePlayerOrganization(request);
if (snapshot is null)
{
await SendNotFoundAsync(cancellationToken);
return;
}
Post("/api/player-faction/organizations");
AllowAnonymous();
}
await SendOkAsync(snapshot, cancellationToken);
}
catch (InvalidOperationException ex)
public override async Task HandleAsync(PlayerOrganizationCommandRequest request, CancellationToken cancellationToken)
{
AddError(ex.Message);
await SendErrorsAsync(cancellation: cancellationToken);
try
{
var snapshot = worldService.CreatePlayerOrganization(request);
if (snapshot is null)
{
await SendNotFoundAsync(cancellationToken);
return;
}
await SendOkAsync(snapshot, cancellationToken);
}
catch (InvalidOperationException ex)
{
AddError(ex.Message);
await SendErrorsAsync(cancellation: cancellationToken);
}
}
}
}