I am developing ASP.NET Core web api. here i have a situation like i have to use multiple get functions which get data from sql server db. So for that i'm doing custom attribute routes. below are my codes
[Route("api/[controller]")] public class MeController : Controller { private readonly ITechRepository _tech; private readonly IPageOptions _page; public MeController(ITechRepository tech,IPageOptions page) { _tech = tech; _page = page; } [Route("getTech")] public IEnumerable<TechStack> Get() { return _tech.getAll(); } [Route("getOptions")] public IEnumerable<PageControl> getOptions() { return _page.getOptions(); } //GET api/values/5 [HttpGet("{id}")] public int Get(int id) { return id; } }
The above routes are works well in VS IIS Express and this is that url http://localhost:51889/api/me/gettech
But when i publish this api in IIS 10. The getTech and getOptions were not working it producing 404 error and also [HttpGet("{id}")] is working in both.
Can anybody help on this...