Your resource is not a list but an object. Better implementation would be something like this.
[HttpGet("{id}")]
public IActionResult Get(string id)
{
using (var unitOfWork = new UnitOfWork(_db))
{
var r = unitOfWork.Resources.Get(id);
if (r == null)
{
return NotFound();
}
return Ok(ConvertResourceModel(r));
}
}
0
solved Can’t use Count() in C#