Closed
Description
Users should be allowed to expose all endpoints, but define the allowable actions by the provided constructor arguments.
So, instead of:
public class TodoItemsController : BaseJsonApiController<TodoItem>
{
public TodoItemsController(
IJsonApiContext jsonApiContext,
ICreateService<TodoItem> create)
: base(jsonApiContext, create: create)
{ }
[HttpPost]
public override async Task<IActionResult> PostAsync([FromBody] T entity) => await base.PostAsync(entity);
}
you can:
public class TodoItemsController : JsonApiController<TodoItem>
{
public TodoItemsController(
IJsonApiContext jsonApiContext,
ICreateService<TodoItem> create)
: base(jsonApiContext, create: create)
{ }
}
all other methods should return HTTP 405 Method Not Allowed