Код: Выделить всё
Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints. Matches:
AirVinyl.Controllers.PeopleController.DeletePerson (AirVinyl)
AirVinyl.Controllers.PeopleController.DeletePerson (AirVinyl)
Код: Выделить всё
[HttpDelete("odata/People({key})")]
public async Task DeletePerson (int key)
{
var currentPersion = await _airVinylDbContext.People.FirstOrDefaultAsync(c=>c.PersonId == key);
if (currentPersion == null)
{
return NotFound(ModelState);
}
_airVinylDbContext.Remove(currentPersion);
await _airVinylDbContext.SaveChangesAsync();
return NoContent();
}
Подтверждено, что мой PeopleController наследует от ODataController.
Очистил и пересобрал решение чтобы исключить устаревшие сборки.
Подробнее здесь: https://stackoverflow.com/questions/792 ... te-request