1 / 43

ASP.NET 3.5 SP1 Dynamic Data, Entity Framework and Data Services

ASP.NET 3.5 SP1 Dynamic Data, Entity Framework and Data Services. Gill Cleeren Microsoft Regional Director /MVP Ordina Belgium www.snowball.be – gill.cleeren@ordina.be With the help of Kurt Claeys MVP Connected Systems. General agenda. ASP.NET Dynamic Data AJAX History

kylee
Download Presentation

ASP.NET 3.5 SP1 Dynamic Data, Entity Framework and Data Services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ASP.NET 3.5 SP1Dynamic Data, Entity Framework and Data Services Gill CleerenMicrosoft RegionalDirector/MVPOrdina Belgium www.snowball.be – gill.cleeren@ordina.beWith the help of Kurt ClaeysMVP Connected Systems

  2. General agenda • ASP.NET Dynamic Data • AJAX History • ADO.NET Entity Framework overview • ADO.NET Data Services

  3. Dynamic data • Introduction • ASP.NET Dynamic Data (using EF) • Scaffolding • Model Metadata • Model Validation • Customization • Field Templates • Page Templates • Custom Pages • Routing • Templating

  4. What is Dynamic Data? • Easily create powerful data-driven web apps • Get a running app in under a minute! • Unleash the power of the schema • Customizable and reusable

  5. The traditional approach • Create your model • Create ASP.NET pages • Add data controls and data source controls • Add validation logic in the page • Issues: • Fair bit of work to get started • Logic lives in the wrong place • Ignores valuable schema information • Reuse and customization is difficult

  6. The Dynamic Data approach • Create your model • Instantly get a fully functional app! • Customize the app piece by piece: • Model • Fields • Pages • Routes

  7. Scaffolding • Data-driven web application • Full CRUD • Templated • AJAX • Extensible

  8. Demo Scaffolding

  9. Model metadata • Metadata on model drives the behavior • Default metadata inferred from schema • Data types and relationships • Required fields, string length, … • Add additional metadata • Validation • Field labels and descriptions • Partial methods

  10. Demo Model Metadata

  11. Validation • Validation • Range • Regular Expression • Required • String Length • Model Validation

  12. Demo Validation

  13. Customizing pages • Page templates • Affect shared behavior across tables • Custom pages for individual tables • Choose the column set • Customize the rendering

  14. Customizing the fields • Fields are rendered using templates • Selected based on field data type • Handle rendering, data binding and validation • Template selection can be overridden • Simple ascx files that can easily be reused across projects

  15. Demo Customization

  16. Routing • Determines how external URLs map to application pages • New ASP.NET feature • Also used by ASP.NET MVC

  17. Demo Routing

  18. Templating • Enhance Existing Controls • GridView • ListView • FormView • DetailsView • Centralized Field Definitions • No repetitive code • Dynamic Controls • DynamicField • DynamicControl • DynamicDataManager • DynamicValidator

  19. Demo Templating

  20. AJAX History • ASP.NET Ajax History

  21. History Back Button History Point #1 History Point #2

  22. AJAX History • Take advantage of browser… • Back/Forward Buttons • Bookmarks • Server-Side • UpdatePanel • ScriptManager • Client-Side • Sys.Application • ScriptManager

  23. Demo AJAX History

  24. Agenda • ADO.NET Entity Framework overview

  25. ADO.NET Data Services • Introduction: Data in the web • ADO.NET Data services • Query syntax • Creating Data Services • Addressing options • Pseudo-Members • Query Options • Clients

  26. Data in the Web HTML + Javascript DLL + XAML Mashup UI Data (XML,JSON,…) Data (XML,JSON,…) Data (XML,JSON,…) Data Feeds AJAX Applications Silverlight Applications Online Services Mashups

  27. A RESTful Interface for Data

  28. Model and Operation Semantics • Underlying data model • Entity Data Model • Entities  Resources • Associations  Links • Operation semantics • Usual mapping of HTTP methods • GET  retrieve resource • POST  create resource • PUT  update resource • DELETE  delete resource

  29. URL Conventions • Addressing entities and sets • Presentation options

  30. Demo Accessing the data

  31. Creating Data Services HTTP • Create services directly from Visual Studio • Various data sources • Entity Framework • LINQ providers • Model-driven • Structural description in Entity Data Model • Metadata shapes service Hosting/HTTP listener Service Runtime IQueryable [+ IUpdatable] Data Access Layer Entity Framework Custom LINQ provider Relational database Other sources

  32. Demo Creating the Data Service

  33. Addressing Pseudo-Members • $metadata • AdventureWorks.svc/$metadata • $value • AdventureWorks.svc/Customers(1)/FirstName/$value • $batch • AdventureWorks.svc/$batch

  34. Query Options • Ordering • $orderby [asc | desc] • Paging • $skip • $top • Filtering • $filter • Eager-Loading • $expand

  35. Demo Advanced quering

  36. Clients Data Service

  37. Modern Data-Driven Web Apps • AJAX integration • AJAX-friendly JSON format in services • Javascript library that integrates with the ASP.NET AJAX toolkit • Silverlight support • .NET programming model for data services • Object based, LINQ enabled API • Code-gen entity types from metadata

  38. "Traditional" Applications • Web applications • Data services client can be used in ASP.NET • ASP.NET data source control for accessing remote services • Desktop applications • Fully-featured .NET client library • Same API in desktop and Silverlight environments

  39. Demo Console app using Data Services

  40. Summary • Dynamic data • Easy scaffolding • Up and running in no time • Very customizable • Ajax History • Really needed • Data services • Easy way for retrieving data • Client dev made easy through proxies

  41. Q&A

  42. Thank you!

  43. ASP.NET 3.5 SP1Dynamic Data, Entity Framework and Data Services Gill CleerenMicrosoft RegionalDirector/MVPOrdina Belgium www.snowball.be – gill.cleeren@ordina.beWith the help of Kurt ClaeysMVP Connected Systems

More Related