Data asservice

668 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
668
On SlideShare
0
From Embeds
0
Number of Embeds
309
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Data asservice

  1. 1. MainframeComputersThick Clients Thin ClientsMobile Apps Browsers Web AppsThey all understand Internet world means how to make HTTP request andread HTTP response. In simple words you can browse Internet here
  2. 2. Dhananjay KumarTelerikData as Service
  3. 3. Agenda• Your Presenter
  4. 4. WCF DataServiceODATAADO.NetDataServiceProjectAstoriahttp://dhananjaykumar.net/
  5. 5. WCF DataServiceODATAADO.NetDataServiceProjectAstoria
  6. 6. Introduction to WCF Data ServiceDemo Creating your first WCF Data ServiceURI Options and Server side pagingDemo performing CRUD from Managed ApplicationQ/AAgenda
  7. 7. It is a web ProtocolIt is used for updating and querying dataIt uses HTTP protocolIt uses ATOM and JSON web message formatsIt uses URI for resource identification (REST)OData is released under the Open Specification Promise to allow anyone tofreely interoperate with OData implementations.OData
  8. 8. Application :SharePoint 2010,IBM Web Sphere , SSRS, SQLAzure , Azure tableLive Services : facebook,Pluralsight , vanGuide ,TechEd2010, NerdDinnerBrowsers , ODATA Explorer , Excel2010 , LINQPAD, SesName OdataBrowserClient Librarries : W7Phone ,Javascript , .Net , PHPPRODUCER CONSUMER12/19/2010 http://dhananjaykumar.net/OData Consumer and Producer
  9. 9. WCF Data Services Framework Consists of acombination of patterns and libraries that enable thecreation and consumption of data services for the web.The goal of WCF DATA Service is to facilitate thecreation of Flexible data Services that are naturallyintegrated with the webWCF Data Service exposes CRUD operation as RESTservice using ODATA protocolWCF Data Service
  10. 10. • CREATE Data in TableHTTP POST• RETERIVE Data from tableHTTP GET• UPDATE Data in tableHTTP PUT• DELETE Data in tableHTTP DELETEHTTP Verbs
  11. 11. MessageFormatJSON ATOMJSON forAJAX clientsATOM forany type ofclientsMessage Format
  12. 12. Custom Data ModelLINQ to SQL ClassADO.Net Entity ModelData Model
  13. 13. Flow Diagram
  14. 14. Demo
  15. 15. 12/19/2010 http://dhananjaykumar.net/
  16. 16. DataServiceContext context = new DataServiceContext(new Uri("http://localhost:7003/WcfDataService1.svc/"));Blogger blog = new Blogger{SpeakerId = 99,SpeakerBlog = "null",SpeakerName = "Mr Bill ",SpeakerTechnology = "Microsoft"};context.AddObject("Bloggers", blog);context.SaveChanges();Create Record
  17. 17. DataServiceContext context = new DataServiceContext(new Uri("http://localhost:7003/WcfDataService1.svc/"));SpeakersEntities entities = new SpeakersEntities(new Uri("http://localhost:7003/WcfDataService1.svc/"));var result = from r in entities.Bloggers select r;foreach (var r in result){Console.WriteLine(r.SpeakerName +r.SpeakerTechnology);}Retrieve Record
  18. 18. DataServiceContext context = new DataServiceContext(new Uri("http://localhost:7003/WcfDataService1.svc/"));SpeakersEntities entities = new SpeakersEntities(new Uri("http://localhost:7003/WcfDataService1.svc/"));Blogger blogtoUpdate = (from r in entities.Bloggers wherer.SpeakerId == 9 selectr).FirstOrDefault();blogtoUpdate.SpeakerTechnology = "C Sharp ";context.AttachTo("Bloggers", blogtoUpdate);context.UpdateObject(blogtoUpdate);context.SaveChanges();Update Record
  19. 19. DataServiceContext context = new DataServiceContext(new Uri("http://localhost:7003/WcfDataService1.svc/"));SpeakersEntities entities = new SpeakersEntities(new Uri("http://localhost:7003/WcfDataService1.svc/"));Blogger blogtoUpdate = (from r in entities.Bloggerswhere r.SpeakerId == 99 selectr).FirstOrDefault();context.AttachTo("Bloggers", blogtoUpdate);context.DeleteObject(blogtoUpdate);context.SaveChanges();Delete Record

×