Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am developing restfull web api's using asp.ne mvc 4.
How to get the child resource from parent resource.
I have a author class with fields
C#
class Author
{
       int id;
       string name;
       Book book;
}
class Book
{
     string bookId;
     string bookName;
     string price;
}

How to get child resource from author controller.
e.g someurl\author >>this url works fine.
But now when i want a particular book , how will it be done.
e.g someurl\author\1\book >>Get list of all books of particular author?
e.g someurl\author\1\book\1 >>Get a particul book of particular author?

Thanks,
-Ajay
Posted
Updated 22-Jan-15 22:52pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900