Created
July 22, 2012 13:50
-
-
Save tugberkugurlu/3159768 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using System.Xml.Serialization; | |
namespace MvcApplication56.Controllers { | |
public class Person { | |
public string Name { get; set; } | |
public virtual ICollection<Order> Orders { get; set; } | |
} | |
public class Order { | |
public string Name { get; set; } | |
} | |
public class PeopleController : ApiController { | |
public IEnumerable<Person> Get() { | |
return new List<Person> { | |
new Person { | |
Name = "Foo", | |
Orders = new List<Order> { | |
new Order { Name = "Bar" } | |
} | |
}, | |
new Person { | |
Name = "Foo", | |
Orders = new List<Order> { | |
new Order { Name = "Bar" } | |
} | |
} | |
}; | |
} | |
public Person Get(int id) { | |
return new Person { | |
Name = "Foo", | |
Orders = new List<Order> { | |
new Order { Name = "Bar" } | |
} | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment