public async Task <IActionResult> Get([FromQuery] MapDownloadParameters parameters) { if (!parameters.IsValid()) { return(NotFound()); } return(parameters.GetRequestType() switch { RequestType.MapDefinition => await GetMapDefinitionAsync(parameters.Map), RequestType.MapPart => await GetMapPartAsync(parameters.Map, parameters.Part), _ => throw new ArgumentOutOfRangeException() });
public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "mapdownload")][FromQuery] MapDownloadParameters parameters, ILogger log, ExecutionContext context) { if (!parameters.IsValid()) { return(new NotFoundResult()); } return(parameters.GetRequestType() switch { RequestType.MapDefinition => await GetMapDefinitionAsync(log, context, parameters.Map), RequestType.MapPart => await GetMapPartAsync(log, context, parameters.Map, parameters.Part), _ => throw new ArgumentOutOfRangeException() });