210 likes | 360 Views
http://dhananjaykumar.net. DEBUGMODE_. Introducing WCF DATA SERVICE. Dhananjay Kumar. Agenda. What is REST ?. REST == Representational State Transfer. WCF Data Service. WCF Data Service. ODATA. ODATA Consumer and Producer. CONSUMER. PRODUCER. WCF Data Service. HTTP Verbs.
E N D
http://dhananjaykumar.net DEBUGMODE_ Introducing WCF DATA SERVICE Dhananjay Kumar
Agenda http://dhananjaykumar.net/
What is REST ? REST == Representational State Transfer http://dhananjaykumar.net/
WCF Data Service http://dhananjaykumar.net/
WCF Data Service http://dhananjaykumar.net/
ODATA http://dhananjaykumar.net/
ODATA Consumer and Producer CONSUMER PRODUCER http://dhananjaykumar.net/
WCF Data Service http://dhananjaykumar.net/
HTTP Verbs http://dhananjaykumar.net/
Message format http://dhananjaykumar.net/
Data Model http://dhananjaykumar.net/
Flow diagram http://dhananjaykumar.net/
DEMO http://dhananjaykumar.net/
URI options http://dhananjaykumar.net/
Create Record DataServiceContext context = newDataServiceContext(newUri("http://localhost:7003/WcfDataService1.svc/")); Blogger blog = newBlogger { SpeakerId = 99, SpeakerBlog = "null", SpeakerName = "Mr Bill ", SpeakerTechnology = "Microsoft" }; context.AddObject("Bloggers", blog); context.SaveChanges(); http://dhananjaykumar.net/
Retrieve Record DataServiceContext context = newDataServiceContext(newUri("http://localhost:7003/WcfDataService1.svc/")); SpeakersEntities entities = newSpeakersEntities(newUri("http://localhost:7003/WcfDataService1.svc/")); var result = from r inentities.Bloggersselect r; foreach (var r in result) { Console.WriteLine(r.SpeakerName+ r.SpeakerTechnology); } http://dhananjaykumar.net/
Update Record DataServiceContext context = newDataServiceContext(newUri("http://localhost:7003/WcfDataService1.svc/")); SpeakersEntities entities = newSpeakersEntities(newUri("http://localhost:7003/WcfDataService1.svc/")); BloggerblogtoUpdate = (from r inentities.Bloggerswherer.SpeakerId== 9 select r).FirstOrDefault(); blogtoUpdate.SpeakerTechnology = "C Sharp "; context.AttachTo("Bloggers", blogtoUpdate); context.UpdateObject(blogtoUpdate); context.SaveChanges(); http://dhananjaykumar.net/
Delete Record DataServiceContext context = newDataServiceContext(newUri("http://localhost:7003/WcfDataService1.svc/")); SpeakersEntities entities = newSpeakersEntities(newUri("http://localhost:7003/WcfDataService1.svc/")); BloggerblogtoUpdate = (from r inentities.Bloggers wherer.SpeakerId == 99 select r).FirstOrDefault(); context.AttachTo("Bloggers", blogtoUpdate); context.DeleteObject(blogtoUpdate); context.SaveChanges(); http://dhananjaykumar.net/
WCF Data Service http://dhananjaykumar.net/
With W7Phone http://dhananjaykumar.net/
http://dhananjaykumar.net DEBUGMODE_ Q & A Dhananjay Kumar