Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 22, 2012 05:18 PM by imran_ku07
Apr 20, 2012 05:49 PM|LINK
I've already setup all the JSON readers. The issue is just that I can't pull say the Category Name / Patent Number from reading throug the categorypatent table.
Apr 20, 2012 07:21 PM|LINK
So the real question is that since my CategoryPatent model is setup with 2 virtuals to my Category / Patent models is it possible to pull the specific field elements by just using the CategoryPatent model or do I need to do more work to pass back those values?
Apr 21, 2012 01:54 PM|LINK
There is no View method in Web API. You need learn more about Web API. See, this
Apr 22, 2012 02:35 AM|LINK
Apr 22, 2012 02:54 AM|LINK
Yes I know there are no views in web API, that was just to show what was in my controller. I'm just wonder if there is a way or not to access model information from another model with web api's like how it's d one within a controller with the .include().
The DbContext class is same in Web APi and MVC.
Apr 22, 2012 01:58 PM|LINK
Apr 22, 2012 05:18 PM|LINK
Then why is it not possible to use it in the same contest that I'm using in my controller to get the name and number? --> db.CategoryPatents.Include(c => c.Category).Include(c => c.Patent);
Can you provide a sample application?