public void Configure(IEndpointRouteBuilder builder) => builder .MapGet("{thru}", context => { var readModel = context.RequestServices.GetRequiredService <InMemoryProjectionDatabase>() .Get <ReadModel>(); if (!readModel.HasValue) { return(new ValueTask <Response>(HalResponse.Create <BalanceSheetReport>(context.Request, new BalanceSheetReportRepresentation(), Optional <Position> .Empty))); } var thru = Time.Parse.LocalDateTime(context.GetRouteValue("thru") !.ToString() !);
public void Configure(IEndpointRouteBuilder builder) => builder .MapGet(string.Empty, context => { var readModel = context.RequestServices.GetRequiredService <InMemoryProjectionDatabase>() .Get <ReadModel>(); return(new(HalResponse.Create(context.Request, new ChartOfAccountsRepresentation(), readModel.HasValue ? readModel.Value.Checkpoint : Optional <Position> .Empty, readModel))); }) .MapCommands(string.Empty, typeof(DefineAccount), typeof(RenameAccount), typeof(DeactivateAccount), typeof(ReactivateAccount));