I made a partial.
I verified that the partial is working (i can type this. and see all the other functions in the other file).
i have tried multiple ways but right now it looks like this
[Route("odata/aci/LstEmployes")]
public partial class LstEmployesController : ODataController
{
[HttpGet("DeleteUnusedLstEmploye({key})")]
public IActionResult DestroyUnusedLstEmploye(int key)
{
try
{
if(!ModelState.IsValid)
{
return BadRequest(ModelState);
}
var item = this.context.LstEmployes.Where(i => i.noEmployeAuto == key).FirstOrDefault();
if (item == null)
{
return BadRequest();
}
///
this.context.LstEmployes.Update(item);
this.context.SaveChanges();
return Ok();
}
catch(Exception ex)
{
ModelState.AddModelError("", ex.Message);
return BadRequest(ModelState);
}
}
and in my service
public async Task DeleteUnusedLstEmploye(int id)
{
var uri = new Uri(baseUri, $"LstEmployes/DeleteUnusedLstEmploye({id})");
var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
var response = await httpClient.SendAsync(httpRequestMessage);
Console.WriteLine(response.ToString());
}
but no matter what i try I cant get to call this endpoint
I suspect there are conventions im not aware of with odata