private async Task <IActionResult> CreateResponse(TributeQueryOptions opts, IAsyncEnumerable <TributesUpdateView> updates) { return(opts.Format switch { TributeOutputFormat.Json => await WriteToJsonResponse(updates), TributeOutputFormat.Csv => await WriteToCsvResponse(updates), _ => throw new ArgumentException("should never happen") });
public async Task <IActionResult> GetTributesHourly([FromQuery] TributeQueryOptions opts) { var updates = _store.GetTributeUpdatesHourly(ToDbOpts(opts, null)); return(await CreateResponse(opts, updates)); }