API conventions
// HTTP method and route
[HttpHead("$CollectionPath/$CollectionKey")]
// Authorization and filters
[HybridAuthorize($EntityPolicy.Assert)]
// OpenAPI metadata
[ProducesResponseType<bool>(StatusCodes.Status200OK)]
[EndpointName("assert$EntityName")]
public async Task<ActionResult<bool>> AssertAsync(
$PrimaryKeyMethodParameters,
CancellationToken cancellation = default)
{
var exists = await _$EntityNameVariableService.AssertAsync($PrimaryKeyMethodArguments, cancellation);
return exists ? Ok() : NotFound();
}Last updated
Was this helpful?