I'm getting this error: ODataUnrecognizedPathException: Resource not found for the segment 'sample'.
Controller Code is like this:
[Produces("application/json")]
[Route("api/Sample")]
public class SampleController : Controller
{
private readonly ISampleBusiness business;
public SampleController(ISampleBusiness _business)
{
business = _business;
}
// GET: api/Sample
[HttpGet]
[EnableQuery]
public async Task<IQueryable<ISGUserDTO>> Get()
{
var data = await business.GetAll();
return data.Data;
}
and
Startup Code like this:
public void ConfigureServices(IServiceCollection services)
{
services.AddOData<ISampleBusiness>(builder => builder.EntitySet<Business.Contracts.DTO.Infra.ISGUserDTO>("Sample"));
Configure like this:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseOData("api");
Any ideas what is wrong?