Introduction to JSON with C#
Microsoft Video Courses · 4 lecciones · Gratis en YouTube
Sobre este curso
hey welcome to this MBA on introducing Jason and c-sharp are really kind of how to work with Jason using c-sharp I’m Christopher Harrison that’s Benjamin Linton Benjamin why don’t you go ahead
and introduce yourself hi I’m Benjamin Lin I’m a program manager intern here at Microsoft I work with hardware and software I’ve some things I’ve worked on I’ve made a Bluetooth power point ring
controller and I’ve made an automatic c-sharp coderaider I am a student at Cal Poly San Luis Obispo and outside of work in school I am a ballroom dancer and I play the harmonica all right as for me
I’m Christopher Harrison I’m a senior content developer here at Microsoft focusing on web OS s asp.net I’m a longtime Microsoft certified trainer I periodically blog I
periodically present at conferences of a marathoner husband and father of one four legged child so Benjamin what are we going to be talking about in this course okay so in this course we have
four main modules the first is an introduction to JSON what is JSON why you should use it the next module will be a overview of the syntax and structure of JSON the next one will be
how to parse and generate a JSON file and lastly we’ll be making an application which uses JSON a JSON file as data storage okay and what do we expect the viewers to have done in the
past what prerequisites do we have oh well we expect them to know c-sharp at an intermediate level we don’t like buttons know any JSON because this is an introductory course
okay on we we suggest that they have Visual Studio 2015 community installed because that is the IDE that we are working with okay that that sounds perfect so so Benjamin
what lets Jason what’s Jason all about Oh what is JSON yeah well let’s start with the first module introduction to JSON make sense so JSON is a lightweight data interchange format it stands for
JavaScript object notation okay so you use it to basically transfer data between different format okay so I can use this too say write data out to a file be able to
load that back up later and I can also use this to send information from one end to another so for example maybe if I’m creating a web application using JavaScript that I could go ahead and
make a server call I could send data over to the server using JSON and receive that back using jasa exactly all right perfect some other reasons why you should use
JSON well first it’s easy for humans to read and write mm-hmm it’s language independent and although it uses the same syntax as JavaScript objects it can be used with pretty much any language
okay and lastly you can be used as a application storage file okay all right that’s perfect now you know one thing that I think is worth highlighting real quickly here is this has a lot of
similarities to XML that we can use XML as well to send information back and forth – right out to a file and so some people might be wondering okay well why would I use this over XML and the main
reason is that with XML unfortunately there’s a lot of bloat to the file because of the fact that you have all of the opening and the closing tags that that go into it
XML can be very verbose and a identical XML file can be much larger than a JSON file and when we’re talking about sending information over the web especially with mobile devices we really
want to limit the amount of data that we’re going to be sending back and forth and Jason allows us to do that mm-hmm so we’ll be using a couple tools in order to work with JSON the first is the
JavaScript serializer class which is built into net hmm and the next tool is the JSON net third-party library which we can acquire through a nougat package so let’s see sample a demo of what JSON
looks like now what does it look like so this is a JSON file so at first glance you can easily pick out that there are a couple things first there are key value pairs you know name address courses
there are curly braces which represents objects and we’ll get into that later and they’re also square brackets which indicate arrays which we’ll also get into later now even if you have no idea
what JSON is no knowledge of it you can still kind of pick out information from this format because it is easy to read so in my visual studio project you can tell that you know the name of this this
data is school of fine art there’s an address it has a list of courses and within each course there’s a subject a teacher and a list of students so very easy to read very easy to work with and
we’ll show you how to work with that in the later modules okay perfect so then I think that’s basically what we wanted to cover here just a little bit of an intro talk a little bit about why we want to
use Jason we took a look at a file and there’s a very good chance that if you’re watching this you might still be looking at that file and going I don’t necessarily completely get that yet
don’t worry that’s exactly what the next module is here for to actually dig deeper into that JSON file so let’s go ahead and put a wrap on this and then we’ll see you in the next module where
we’ll dig deeper into that JSON file
SIEMPRE HAY ALGO MÁS