Guest User

jsonpelda

a guest
Mar 5th, 2013
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public class A
  2. {
  3. public B PropertyB{ get; set; }
  4. }
  5.  
  6. public class B
  7. {
  8. public A PropertyA { get; set; }
  9.  
  10. }
  11. public class HomeController : Controller
  12. {
  13. public JsonResult Index()
  14. {
  15. var a = new A
  16. {
  17. PropertyB = new B
  18. {
  19. PropertyA = new A()
  20. }
  21. };
  22.  
  23. return this.Json(a,JsonRequestBehavior.AllowGet);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment