It's essentially just a controller that doesn't return a view, only data. You generally hae a Controllers/Api/ folder that contains things like FreightElementController.cs
It's possible that the api isn't in your project at all. For the url provided, do you see any "base" urls nearby? Whatever goes in front of ___/api/freightelement/GetElements
Sometimes people split Api's from the front-ends for scalability reasons
well somewhere something needs to be defined that is either a localhost or an freightApi.com. Can you run the app with dev tools open and see where the data is actually coming from?
@alex that said I can tell you that in my view i have a reference to a knockout page so what you just said is exactly what I did
the only thing I want to ask you is if I need a fake controller to start the webapi controller
otherwise how can I link the needed page in the menu in layout.cshtml???????????
<li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, null)</li>
<li>@Html.ActionLink("Book", "Book", "Books", new { area = "" }, null)</li>
the second menu item which is book it can't be found
where Book is the displayed name Book is view page name and Books is the controller name which you said earlier that shouldn't be used
@Riccardo you should have two sets of controllers, normal MVC controllers to return a view (even if it just embeds a single-page javascript app) and a set of WebAPI controllers that your javascript will make calls to to retreive data
@dckuehn I already have this stuff all I miss is a menu
I mean I'm in the home section and want to go to bookshop section how do I navigate using the menu?
in essence based on the above code what is the wrong section???
<li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, null)</li> <li>@Html.ActionLink("Book", "Book", "Books", new { area = "" }, null)</li>
the second <li> is not found when I click it in the homepage
Dude I can't just tell you that. I don't think your code is organzied the right way. I agree that you need a WebApi controller but it shouldn't be returning a View();
I need to: Sort list of candidates for a job by wanted_sallary (asc), at the end add candidates without wanted_sallary (null), if you have more then one candidate for a job with the same wanted_sallary, priority have earlier applications (date_of_application), throw away all candidates without 3 years of experience (by method)
Do i need to make some sorting method for this or I can use someone?
I'm trying to sort a list of products by their price.
The result set needs to list products by price from low to high by the column LowestPrice. However, this column is nullable.
I can sort the list in descending order like so:
var products = from p in _context.Products
where p.ProductTyp...