Articles → .NET → Paste JSON As Classes In Visual Studio 2013

Paste JSON As Classes In Visual Studio 2013






Create A Sample JSON




{
  "Name": "Karan Gupta",
  "Age": 28,
  "Technology": "JSON",
  "Address": {
    "City": "Gurgaon",
    "State": "Haryana"
  }
}



Create A Sample Project




using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Demo {
	public class PasteJsonAsClasses {}
}




using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Demo {

}



Paste JSON As Classes




Picture showing Paste JSON as classes option in visual studio 2013
Click to Enlarge



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Demo {

	public class Rootobject {
		public string Name {
			get;
			set;
		}
		public int Age {
			get;
			set;
		}
		public string Technology {
			get;
			set;
		}
		public Address Address {
			get;
			set;
		}
	}

	public class Address {
		public string City {
			get;
			set;
		}
		public string State {
			get;
			set;
		}
	}

}



Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, January 20, 2016

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250