SlideShare a Scribd company logo
.NET 3.5 Enhancements (SP1)Dave AllenISV Application ArchitectDeveloper and Platform GroupMicrosoft UK
AgendaADO.NET Entity FrameworkADO.NET Data ServicesASP.NET RoutingASP.NET Dynamic Data
ADO.NET Entity FrameworkAnother data access technology!?!Not designed to replace what has gone beforeAddresses the OOP versus Relational problemOOP very well establishedRelational have been around even longerBridging the gap has mostly been a manual taskSome 3rd party solutions, core problem remainsObjects != Relational DataFundamental problem is that relational data and objects in a programming language are NOT the same!They have different semantics, languages, etc.But both are still needed in most applications
ADO.NET Entity FrameworkEntity Data ModelModels Entities and relationships between those EntitiesHow does it bridge the gap between OOP and RelationalCommon type systemInheritanceComplex typesEDM is scoped to just modeling design of application dataEntity FrameworkProvides services for consuming an EDMObject ServicesEntity Client (EntityConnection, EntityDataReader, etc.)Entity SQLLINQ To EntitiesProvider model for 3rd party databases
Entity Data ModelApplication modelMapped to a persistence storeComprised of three layers:Conceptual (CSDL)Mapping (MSL)Storage (SSDL)Database agnosticNot compiledEmbed as a resourceStore externallyEntity Data ModelConceptualMappingStorage
DemoEntity Data Model
Entity FrameworkEDM consumption options:Entity ClientEntity SQLObject ServicesEntity SQLLINQ To Entities
Entity ClientFamiliar ADO.NET object model:EntityCommandEntityConnectionEntityDataReaderEntity ParameterEntityTransactionText-based resultsRead-onlyUses Entity SQL
Entity SQLSQL-like query language
Targets conceptual model
Database agnosticT-SQLEntity SQL
DemoEntity Client
Object ServicesObject materialized queriesObjectContextObjectQuery<T>Built on top of Entity ClientTwo query options:Entity SQLLINQRuntime services:Unit of workIdentity trackingEager/explicit loading
DemoObject Services
Entity Framework – Service StackLINQ To EntitiesEntity SQLObject ServicesEntity ClientADO.NET Provider
Entity Framework featuresMany to many relationshipsJoin tables ignored by designer in EDMSide-effect, relationships cannot contain dataLINQ supports this via the aggregate functionsInheritanceAllows Entities to be specializedMaps to CLR inheritanceFully supported in queries3 types of inheritanceTable per typeTable per hierarchyTable per concrete type
Entity Framework features (2)Entity splittingSingle entity split across multiple tables, something you may do with very large tablesStored proceduresMost asked question about EFFully supported for CUD, map CUD functions to SPsMainly supported for queries, but doesn’t support composable queries, dynamic SQL within SPsNo metadata available at design-timeWorking against principles of EFDon’t use EF if you do thisConsider using TVF instead of SPs
LINQ to SQL or Entity FrameworkThe case for LINQ to SQLUse an ORM solution where database is 1:1 with Object ModelUse an ORM solution with inheritance hierarchies that are stored in a single tableUse POCO instead of using generated classes or deriving from a base class or implementing an interfaceLeverage LINQ as the way to write queriesUse an ORM solution, but want something that is very performant and where optimization can be achieved, where necessary, through stored procedures
LINQ to SQL or Entity Framework (2)The case for LINQ to EntitiesWrite applications that can target different database engines in addition to SQL ServerDefine domain models for applications and use them as the basis for the persistence layerUse an ORM solution where classes may be 1:1 with the database or may have a different structure from the database schemaUse an ORM solution with inheritance that may have alternative storage schemes (single table for the hierarchy, single table for each class, single table for all data related to specific type)Leverage LINQ as the way to write queries and have the query work in a database vendor agnostic mannerUse an ORM solution, but want something that is very performant and where optimization can be achieved, where necessary, through stored procedures
Data Service over HTTPHTML + JavaScriptDLL + XAMLMashup UIData (XML, etc)Data (XML, etc)Data (XML, etc)Data FeedsAJAX ApplicationsSilverlight ApplicationsOnline ServicesMashups
Data Services todayWeb Service (ASMX, WCF)1) GetCustomer(int id)2) GetCustomers()3) GetCustomers(string orderBy)4) GetCustomers(string orderBy, string sortDirection)5) GetCustomers(string orderBy, string sortDirection,int offset, int count)6) GetCustomers(string orderBy, string sortDirection,int offset, int count,		    string filter, string filterValue)
ADO.NET Data ServicesData publishing service using a RESTful interfaceJust uses HTTPTherefore is able to use existing authentication mechanisms, and  other infrastructure components such as caching and proxiesUniform URL SyntaxEvery piece of information is addressablePredictable and flexible URL syntaxMultiple representationsATOMJSONPOX
ADO.NET Data Services (2)Exposes an object model (not a database) over the webEntity Data Model – ADO.NET DS designed to work with EDMLINQ To SQL model, read-onlyCustom IQueryable<T> providerOperation semantics, mapping of HTTP verbs for CRUD operationsGET – retrieve resourcePOST – create a resourcePUT – update a resourceDELETE – delete a resource
URL ConventionsAddressing entities and setsPresentation options
FiltersLogical operatorsand, or , asc, desc, eq, ne, true, false, gt, ge, lt, le, not, nullArithmetic operatorsadd, sub, div, mul, modString functionsendswith, indexof, replace, startswith, tolower, toupper, trim, substring, substringof, concat, lengthDate functionsyear, month, day, hour, minute, secondMath functionsround, floor, ceilingType functionsIs, Cast
DemoADO.NET Data Services – Adventure Works
Securing and Customizing Data ServicesVisibilityControl visibility per containerRead, Query, and Write optionsAuthenticationIntegrates with the hosting environmentASP.NET, WCF, or Custom authentication moduleInterceptorsExecute before HTTP GET/PUT/POST/DELETEEnable validation, custom row-level securityMaintain the REST interfaceService operationsAllow you to inject methods into URI if you need to
ClientsData Service
ASP.NET AJAX ClientServerClientDataServiceSys.Data.DataServiceHTTPDataModelJSON
ASP.NET AJAX ClientSys.Data.ActionSequenceSys.Data.DataServiceSys.Data.QueryBuilder
.NET ClientServerClientDataServiceDataServiceContextHTTPDataModelObjectModel
DemoSilverlight 2.0 Client - Northwind
Operation BatchingWithout batchingDataServiceContextDataServicePOSTPUTPOSTDELETEDELETE5 server hitsOperations:Add Entity #1Update EntityAdd Entity #2Delete Entity #1Delete Entity #2
Operation BatchingWith batchingDataServiceContextDataServicePOST /$batch1 server hitOperations:Add EntityUpdate EntityAdd Entity #2Delete EntityDelete Entity #2
Operation BatchingWithout batchingDataServiceContextDataServiceGETGETGET3 server hitsOperations:Get Entity #1Get Entity #2Get Entity #3
Operation BatchingWith batchingDataServiceContextDataServiceGET /$batch1 server hitOperations:Get Entity #1Get Entity #2Get Entity #3
DemoOperation Batching
ASP.NET RoutingDefine your application’s URL entry pointsStatic (/Products/Edit/23)Parameterized (/Blog/{year}/{month} /{day})Map these URL templates to route handlersGenerate URLs based off your defined route tableCan be leveraged by ASP.NET…WebFormsMVC (using)Dynamic Data (using)
DemoASP.NET  Routing
ASP.NET Dynamic DataRAD approach to building data driven web appsBased on top of object modelLINQ To SQLEntity Data ModelData-driven web application ‘scaffolding’Uses the power of the underlying schemaCustomizable through templatesFull CRUD operationsAJAX-enabledExtend the modelMetadataValidation
ASP.NET – traditional approachCreate a data access layerADO.NET (Datasets, Custom Objects, XML, etc.)LINQ to SQLCreated ASP.NET pagesAdd Data Source controlsAdd controls that bind to Data Source controlsAdd validation logic to pageIssuesLots of work up frontDuplication of validation logicDB schema ignored – data validation ends up in UIReuse needs to be thought about – not intuitive
ASP.NET – dynamic data approachCreate a data modelEntity FrameworkLINQ to SQLGenerate a Dynamic Data applicationCustomize the applicationModel FieldsPagesRoutes
Annotating the modelMetadata on model controls behaviorDefault metadata inferred from schemaData types and relationshipsRequired fields, field type, string length, etc.Generate a Dynamic Data applicationAdd additional metadataValidation Field labels and descriptionsPartial methods
DemoASP.NET Dynamic Data
Field templatesFields are rendered using templatesImplemented as a user control .ascxControls the rendering, data binding, and validationBased on the field data type, integer, bool, string, etc.Default selection can be overriddenDefault field templates ‘out-of-the-box’These can be customized – they are just user controlsCreate new field templates
Dynamic Data ControlsDynamicDataManagerGridView, DetailsViewDynamicDataFieldListView, FormViewDynamicControlLinqDataSource, EntitiesDataSourceDynamicControlParameterDynamicQueryStringParameterDynamicValidatorDynamicFilter, FilterRepeater
DemoASP.NET Dynamic Data – Field Templates
.NET 3.5 SP1 – What’s been improvedASP.NET AJAXWCFWPFWinForms
Ad

More Related Content

What's hot (20)

L15 Data Source Layer
L15 Data Source LayerL15 Data Source Layer
L15 Data Source Layer
Ólafur Andri Ragnarsson
 
Mapping Data Flows Training deck Q1 CY22
Mapping Data Flows Training deck Q1 CY22Mapping Data Flows Training deck Q1 CY22
Mapping Data Flows Training deck Q1 CY22
Mark Kromer
 
Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Introducing Entity Framework 4.0
Introducing Entity Framework 4.0
Bishoy Demian
 
Spark MLlib - Training Material
Spark MLlib - Training Material Spark MLlib - Training Material
Spark MLlib - Training Material
Bryan Yang
 
Azure Data Factory Data Flows Training (Sept 2020 Update)
Azure Data Factory Data Flows Training (Sept 2020 Update)Azure Data Factory Data Flows Training (Sept 2020 Update)
Azure Data Factory Data Flows Training (Sept 2020 Update)
Mark Kromer
 
Reproducible AI using MLflow and PyTorch
Reproducible AI using MLflow and PyTorchReproducible AI using MLflow and PyTorch
Reproducible AI using MLflow and PyTorch
Databricks
 
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Jason L Brugger
 
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Michael Rys
 
L08 Data Source Layer
L08 Data Source LayerL08 Data Source Layer
L08 Data Source Layer
Ólafur Andri Ragnarsson
 
Introducing the Entity Framework
Introducing the Entity FrameworkIntroducing the Entity Framework
Introducing the Entity Framework
LearnNowOnline
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
Mahmoud Tolba
 
24 Hour of PASS: Taking SQL Server into the Beyond Relational Realm
24 Hour of PASS: Taking SQL Server into the Beyond Relational Realm24 Hour of PASS: Taking SQL Server into the Beyond Relational Realm
24 Hour of PASS: Taking SQL Server into the Beyond Relational Realm
Michael Rys
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
James Johnson
 
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Michael Rys
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL Server
Stéphane Fréchette
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Michael Rys
 
Entity Framework - Queries
Entity Framework -  QueriesEntity Framework -  Queries
Entity Framework - Queries
Eyal Vardi
 
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLTaming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Michael Rys
 
Spark SQL In Depth www.syedacademy.com
Spark SQL In Depth www.syedacademy.comSpark SQL In Depth www.syedacademy.com
Spark SQL In Depth www.syedacademy.com
Syed Hadoop
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best Practices
Andri Yadi
 
Mapping Data Flows Training deck Q1 CY22
Mapping Data Flows Training deck Q1 CY22Mapping Data Flows Training deck Q1 CY22
Mapping Data Flows Training deck Q1 CY22
Mark Kromer
 
Introducing Entity Framework 4.0
Introducing Entity Framework 4.0Introducing Entity Framework 4.0
Introducing Entity Framework 4.0
Bishoy Demian
 
Spark MLlib - Training Material
Spark MLlib - Training Material Spark MLlib - Training Material
Spark MLlib - Training Material
Bryan Yang
 
Azure Data Factory Data Flows Training (Sept 2020 Update)
Azure Data Factory Data Flows Training (Sept 2020 Update)Azure Data Factory Data Flows Training (Sept 2020 Update)
Azure Data Factory Data Flows Training (Sept 2020 Update)
Mark Kromer
 
Reproducible AI using MLflow and PyTorch
Reproducible AI using MLflow and PyTorchReproducible AI using MLflow and PyTorch
Reproducible AI using MLflow and PyTorch
Databricks
 
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Hands-On with U-SQL and Azure Data Lake Analytics (ADLA)
Jason L Brugger
 
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Modernizing ETL with Azure Data Lake: Hyperscale, multi-format, multi-platfor...
Michael Rys
 
Introducing the Entity Framework
Introducing the Entity FrameworkIntroducing the Entity Framework
Introducing the Entity Framework
LearnNowOnline
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
Mahmoud Tolba
 
24 Hour of PASS: Taking SQL Server into the Beyond Relational Realm
24 Hour of PASS: Taking SQL Server into the Beyond Relational Realm24 Hour of PASS: Taking SQL Server into the Beyond Relational Realm
24 Hour of PASS: Taking SQL Server into the Beyond Relational Realm
Michael Rys
 
Entity Framework Database and Code First
Entity Framework Database and Code FirstEntity Framework Database and Code First
Entity Framework Database and Code First
James Johnson
 
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Best Practices and Performance Tuning of U-SQL in Azure Data Lake (SQL Konfer...
Michael Rys
 
Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL Server
Stéphane Fréchette
 
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Tuning and Optimizing U-SQL Queries (SQLPASS 2016)
Michael Rys
 
Entity Framework - Queries
Entity Framework -  QueriesEntity Framework -  Queries
Entity Framework - Queries
Eyal Vardi
 
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQLTaming the Data Science Monster with A New ‘Sword’ – U-SQL
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
Michael Rys
 
Spark SQL In Depth www.syedacademy.com
Spark SQL In Depth www.syedacademy.comSpark SQL In Depth www.syedacademy.com
Spark SQL In Depth www.syedacademy.com
Syed Hadoop
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best Practices
Andri Yadi
 

Viewers also liked (17)

Ventures Hub - a business incubator
Ventures Hub - a business incubatorVentures Hub - a business incubator
Ventures Hub - a business incubator
Ventures Hub Sp z oo
 
WPF & Silverlight UI
WPF & Silverlight UIWPF & Silverlight UI
WPF & Silverlight UI
Dave Allen
 
AppSense Environment Manager 8.5 Beta
AppSense Environment Manager 8.5 BetaAppSense Environment Manager 8.5 Beta
AppSense Environment Manager 8.5 Beta
Dave Allen
 
Bessones canvi consonant
Bessones canvi consonantBessones canvi consonant
Bessones canvi consonant
monik3mng
 
Leonardodavinci
Leonardodavinci Leonardodavinci
Leonardodavinci
monik3mng
 
Estimulacio visual-nadons ppt
Estimulacio visual-nadons pptEstimulacio visual-nadons ppt
Estimulacio visual-nadons ppt
monik3mng
 
Programaconscienciafonologica pag 27 35 p4
Programaconscienciafonologica pag 27 35 p4Programaconscienciafonologica pag 27 35 p4
Programaconscienciafonologica pag 27 35 p4
monik3mng
 
Silverlight 2.0
Silverlight 2.0Silverlight 2.0
Silverlight 2.0
Dave Allen
 
The Bright Bird by Brian Armour
The Bright Bird by Brian ArmourThe Bright Bird by Brian Armour
The Bright Bird by Brian Armour
Andrea Walker
 
WPF & Silverlight Intro
WPF & Silverlight IntroWPF & Silverlight Intro
WPF & Silverlight Intro
Dave Allen
 
Bona ortografia docents_cat
Bona ortografia docents_catBona ortografia docents_cat
Bona ortografia docents_cat
monik3mng
 
AppSense EM 8.5 Deep Dive
AppSense EM 8.5 Deep DiveAppSense EM 8.5 Deep Dive
AppSense EM 8.5 Deep Dive
Dave Allen
 
Animals de la granja
Animals de la granjaAnimals de la granja
Animals de la granja
monik3mng
 
Data Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight ApplicationsData Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight Applications
Dave Allen
 
Library orientation 2010
Library orientation 2010Library orientation 2010
Library orientation 2010
Andrea Walker
 
Lectura de frases
Lectura de frasesLectura de frases
Lectura de frases
monik3mng
 
Abecedari lligada
Abecedari lligadaAbecedari lligada
Abecedari lligada
monik3mng
 
Ventures Hub - a business incubator
Ventures Hub - a business incubatorVentures Hub - a business incubator
Ventures Hub - a business incubator
Ventures Hub Sp z oo
 
WPF & Silverlight UI
WPF & Silverlight UIWPF & Silverlight UI
WPF & Silverlight UI
Dave Allen
 
AppSense Environment Manager 8.5 Beta
AppSense Environment Manager 8.5 BetaAppSense Environment Manager 8.5 Beta
AppSense Environment Manager 8.5 Beta
Dave Allen
 
Bessones canvi consonant
Bessones canvi consonantBessones canvi consonant
Bessones canvi consonant
monik3mng
 
Leonardodavinci
Leonardodavinci Leonardodavinci
Leonardodavinci
monik3mng
 
Estimulacio visual-nadons ppt
Estimulacio visual-nadons pptEstimulacio visual-nadons ppt
Estimulacio visual-nadons ppt
monik3mng
 
Programaconscienciafonologica pag 27 35 p4
Programaconscienciafonologica pag 27 35 p4Programaconscienciafonologica pag 27 35 p4
Programaconscienciafonologica pag 27 35 p4
monik3mng
 
Silverlight 2.0
Silverlight 2.0Silverlight 2.0
Silverlight 2.0
Dave Allen
 
The Bright Bird by Brian Armour
The Bright Bird by Brian ArmourThe Bright Bird by Brian Armour
The Bright Bird by Brian Armour
Andrea Walker
 
WPF & Silverlight Intro
WPF & Silverlight IntroWPF & Silverlight Intro
WPF & Silverlight Intro
Dave Allen
 
Bona ortografia docents_cat
Bona ortografia docents_catBona ortografia docents_cat
Bona ortografia docents_cat
monik3mng
 
AppSense EM 8.5 Deep Dive
AppSense EM 8.5 Deep DiveAppSense EM 8.5 Deep Dive
AppSense EM 8.5 Deep Dive
Dave Allen
 
Animals de la granja
Animals de la granjaAnimals de la granja
Animals de la granja
monik3mng
 
Data Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight ApplicationsData Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight Applications
Dave Allen
 
Library orientation 2010
Library orientation 2010Library orientation 2010
Library orientation 2010
Andrea Walker
 
Lectura de frases
Lectura de frasesLectura de frases
Lectura de frases
monik3mng
 
Abecedari lligada
Abecedari lligadaAbecedari lligada
Abecedari lligada
monik3mng
 
Ad

Similar to ASP.NET 3.5 SP1 (20)

Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
David McCarter
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
David McCarter
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
Igor Moochnick
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
ukdpe
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
Karen Benoit
 
Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)
Ivo Andreev
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
llangit
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
llangit
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
llangit
 
Dev Sql Beyond Relational
Dev Sql Beyond RelationalDev Sql Beyond Relational
Dev Sql Beyond Relational
rsnarayanan
 
Microsoft Database Options
Microsoft Database OptionsMicrosoft Database Options
Microsoft Database Options
David Chou
 
Roles y Responsabilidades en SQL Azure
Roles y Responsabilidades en SQL AzureRoles y Responsabilidades en SQL Azure
Roles y Responsabilidades en SQL Azure
Eduardo Castro
 
Ikenstudiolive
IkenstudioliveIkenstudiolive
Ikenstudiolive
iken Solutions - Web Space-
 
Introducing Oslo
Introducing OsloIntroducing Oslo
Introducing Oslo
Suresh Veeragoni
 
Windows Azure: Lessons From The Field
Windows Azure: Lessons From The FieldWindows Azure: Lessons From The Field
Windows Azure: Lessons From The Field
Rob Gillen
 
Azure for ug
Azure for ugAzure for ug
Azure for ug
dotNETUserGroupDnipro
 
Azure: Lessons From The Field
Azure: Lessons From The FieldAzure: Lessons From The Field
Azure: Lessons From The Field
Rob Gillen
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
brendonschwartz
 
Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010
David McCarter
 
Time for a REST - .NET Framework v3.5 & RESTful Web Services
Time for a REST - .NET Framework v3.5 & RESTful Web ServicesTime for a REST - .NET Framework v3.5 & RESTful Web Services
Time for a REST - .NET Framework v3.5 & RESTful Web Services
ukdpe
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
David McCarter
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
David McCarter
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
Igor Moochnick
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
ukdpe
 
Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)Dare to build vertical design with relational data (Entity-Attribute-Value)
Dare to build vertical design with relational data (Entity-Attribute-Value)
Ivo Andreev
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
llangit
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
llangit
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
llangit
 
Dev Sql Beyond Relational
Dev Sql Beyond RelationalDev Sql Beyond Relational
Dev Sql Beyond Relational
rsnarayanan
 
Microsoft Database Options
Microsoft Database OptionsMicrosoft Database Options
Microsoft Database Options
David Chou
 
Roles y Responsabilidades en SQL Azure
Roles y Responsabilidades en SQL AzureRoles y Responsabilidades en SQL Azure
Roles y Responsabilidades en SQL Azure
Eduardo Castro
 
Windows Azure: Lessons From The Field
Windows Azure: Lessons From The FieldWindows Azure: Lessons From The Field
Windows Azure: Lessons From The Field
Rob Gillen
 
Azure: Lessons From The Field
Azure: Lessons From The FieldAzure: Lessons From The Field
Azure: Lessons From The Field
Rob Gillen
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
brendonschwartz
 
Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010
David McCarter
 
Time for a REST - .NET Framework v3.5 & RESTful Web Services
Time for a REST - .NET Framework v3.5 & RESTful Web ServicesTime for a REST - .NET Framework v3.5 & RESTful Web Services
Time for a REST - .NET Framework v3.5 & RESTful Web Services
ukdpe
 
Ad

Recently uploaded (20)

Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 

ASP.NET 3.5 SP1

  • 1. .NET 3.5 Enhancements (SP1)Dave AllenISV Application ArchitectDeveloper and Platform GroupMicrosoft UK
  • 2. AgendaADO.NET Entity FrameworkADO.NET Data ServicesASP.NET RoutingASP.NET Dynamic Data
  • 3. ADO.NET Entity FrameworkAnother data access technology!?!Not designed to replace what has gone beforeAddresses the OOP versus Relational problemOOP very well establishedRelational have been around even longerBridging the gap has mostly been a manual taskSome 3rd party solutions, core problem remainsObjects != Relational DataFundamental problem is that relational data and objects in a programming language are NOT the same!They have different semantics, languages, etc.But both are still needed in most applications
  • 4. ADO.NET Entity FrameworkEntity Data ModelModels Entities and relationships between those EntitiesHow does it bridge the gap between OOP and RelationalCommon type systemInheritanceComplex typesEDM is scoped to just modeling design of application dataEntity FrameworkProvides services for consuming an EDMObject ServicesEntity Client (EntityConnection, EntityDataReader, etc.)Entity SQLLINQ To EntitiesProvider model for 3rd party databases
  • 5. Entity Data ModelApplication modelMapped to a persistence storeComprised of three layers:Conceptual (CSDL)Mapping (MSL)Storage (SSDL)Database agnosticNot compiledEmbed as a resourceStore externallyEntity Data ModelConceptualMappingStorage
  • 7. Entity FrameworkEDM consumption options:Entity ClientEntity SQLObject ServicesEntity SQLLINQ To Entities
  • 8. Entity ClientFamiliar ADO.NET object model:EntityCommandEntityConnectionEntityDataReaderEntity ParameterEntityTransactionText-based resultsRead-onlyUses Entity SQL
  • 13. Object ServicesObject materialized queriesObjectContextObjectQuery<T>Built on top of Entity ClientTwo query options:Entity SQLLINQRuntime services:Unit of workIdentity trackingEager/explicit loading
  • 15. Entity Framework – Service StackLINQ To EntitiesEntity SQLObject ServicesEntity ClientADO.NET Provider
  • 16. Entity Framework featuresMany to many relationshipsJoin tables ignored by designer in EDMSide-effect, relationships cannot contain dataLINQ supports this via the aggregate functionsInheritanceAllows Entities to be specializedMaps to CLR inheritanceFully supported in queries3 types of inheritanceTable per typeTable per hierarchyTable per concrete type
  • 17. Entity Framework features (2)Entity splittingSingle entity split across multiple tables, something you may do with very large tablesStored proceduresMost asked question about EFFully supported for CUD, map CUD functions to SPsMainly supported for queries, but doesn’t support composable queries, dynamic SQL within SPsNo metadata available at design-timeWorking against principles of EFDon’t use EF if you do thisConsider using TVF instead of SPs
  • 18. LINQ to SQL or Entity FrameworkThe case for LINQ to SQLUse an ORM solution where database is 1:1 with Object ModelUse an ORM solution with inheritance hierarchies that are stored in a single tableUse POCO instead of using generated classes or deriving from a base class or implementing an interfaceLeverage LINQ as the way to write queriesUse an ORM solution, but want something that is very performant and where optimization can be achieved, where necessary, through stored procedures
  • 19. LINQ to SQL or Entity Framework (2)The case for LINQ to EntitiesWrite applications that can target different database engines in addition to SQL ServerDefine domain models for applications and use them as the basis for the persistence layerUse an ORM solution where classes may be 1:1 with the database or may have a different structure from the database schemaUse an ORM solution with inheritance that may have alternative storage schemes (single table for the hierarchy, single table for each class, single table for all data related to specific type)Leverage LINQ as the way to write queries and have the query work in a database vendor agnostic mannerUse an ORM solution, but want something that is very performant and where optimization can be achieved, where necessary, through stored procedures
  • 20. Data Service over HTTPHTML + JavaScriptDLL + XAMLMashup UIData (XML, etc)Data (XML, etc)Data (XML, etc)Data FeedsAJAX ApplicationsSilverlight ApplicationsOnline ServicesMashups
  • 21. Data Services todayWeb Service (ASMX, WCF)1) GetCustomer(int id)2) GetCustomers()3) GetCustomers(string orderBy)4) GetCustomers(string orderBy, string sortDirection)5) GetCustomers(string orderBy, string sortDirection,int offset, int count)6) GetCustomers(string orderBy, string sortDirection,int offset, int count, string filter, string filterValue)
  • 22. ADO.NET Data ServicesData publishing service using a RESTful interfaceJust uses HTTPTherefore is able to use existing authentication mechanisms, and other infrastructure components such as caching and proxiesUniform URL SyntaxEvery piece of information is addressablePredictable and flexible URL syntaxMultiple representationsATOMJSONPOX
  • 23. ADO.NET Data Services (2)Exposes an object model (not a database) over the webEntity Data Model – ADO.NET DS designed to work with EDMLINQ To SQL model, read-onlyCustom IQueryable<T> providerOperation semantics, mapping of HTTP verbs for CRUD operationsGET – retrieve resourcePOST – create a resourcePUT – update a resourceDELETE – delete a resource
  • 24. URL ConventionsAddressing entities and setsPresentation options
  • 25. FiltersLogical operatorsand, or , asc, desc, eq, ne, true, false, gt, ge, lt, le, not, nullArithmetic operatorsadd, sub, div, mul, modString functionsendswith, indexof, replace, startswith, tolower, toupper, trim, substring, substringof, concat, lengthDate functionsyear, month, day, hour, minute, secondMath functionsround, floor, ceilingType functionsIs, Cast
  • 26. DemoADO.NET Data Services – Adventure Works
  • 27. Securing and Customizing Data ServicesVisibilityControl visibility per containerRead, Query, and Write optionsAuthenticationIntegrates with the hosting environmentASP.NET, WCF, or Custom authentication moduleInterceptorsExecute before HTTP GET/PUT/POST/DELETEEnable validation, custom row-level securityMaintain the REST interfaceService operationsAllow you to inject methods into URI if you need to
  • 33. Operation BatchingWithout batchingDataServiceContextDataServicePOSTPUTPOSTDELETEDELETE5 server hitsOperations:Add Entity #1Update EntityAdd Entity #2Delete Entity #1Delete Entity #2
  • 34. Operation BatchingWith batchingDataServiceContextDataServicePOST /$batch1 server hitOperations:Add EntityUpdate EntityAdd Entity #2Delete EntityDelete Entity #2
  • 35. Operation BatchingWithout batchingDataServiceContextDataServiceGETGETGET3 server hitsOperations:Get Entity #1Get Entity #2Get Entity #3
  • 36. Operation BatchingWith batchingDataServiceContextDataServiceGET /$batch1 server hitOperations:Get Entity #1Get Entity #2Get Entity #3
  • 38. ASP.NET RoutingDefine your application’s URL entry pointsStatic (/Products/Edit/23)Parameterized (/Blog/{year}/{month} /{day})Map these URL templates to route handlersGenerate URLs based off your defined route tableCan be leveraged by ASP.NET…WebFormsMVC (using)Dynamic Data (using)
  • 40. ASP.NET Dynamic DataRAD approach to building data driven web appsBased on top of object modelLINQ To SQLEntity Data ModelData-driven web application ‘scaffolding’Uses the power of the underlying schemaCustomizable through templatesFull CRUD operationsAJAX-enabledExtend the modelMetadataValidation
  • 41. ASP.NET – traditional approachCreate a data access layerADO.NET (Datasets, Custom Objects, XML, etc.)LINQ to SQLCreated ASP.NET pagesAdd Data Source controlsAdd controls that bind to Data Source controlsAdd validation logic to pageIssuesLots of work up frontDuplication of validation logicDB schema ignored – data validation ends up in UIReuse needs to be thought about – not intuitive
  • 42. ASP.NET – dynamic data approachCreate a data modelEntity FrameworkLINQ to SQLGenerate a Dynamic Data applicationCustomize the applicationModel FieldsPagesRoutes
  • 43. Annotating the modelMetadata on model controls behaviorDefault metadata inferred from schemaData types and relationshipsRequired fields, field type, string length, etc.Generate a Dynamic Data applicationAdd additional metadataValidation Field labels and descriptionsPartial methods
  • 45. Field templatesFields are rendered using templatesImplemented as a user control .ascxControls the rendering, data binding, and validationBased on the field data type, integer, bool, string, etc.Default selection can be overriddenDefault field templates ‘out-of-the-box’These can be customized – they are just user controlsCreate new field templates
  • 46. Dynamic Data ControlsDynamicDataManagerGridView, DetailsViewDynamicDataFieldListView, FormViewDynamicControlLinqDataSource, EntitiesDataSourceDynamicControlParameterDynamicQueryStringParameterDynamicValidatorDynamicFilter, FilterRepeater
  • 47. DemoASP.NET Dynamic Data – Field Templates
  • 48. .NET 3.5 SP1 – What’s been improvedASP.NET AJAXWCFWPFWinForms
  • 49. Visual Studio 2008 SP1 – What’s else?SQL 2008JavaScript formatting and code preferencesImproved JavaScript IntellisenseClassic ASP Intellisense/DebuggingWCF refactoring support (svc/config files).NET Framework Client Profile26mb download

Editor's Notes

  • #3: Talking Points: .NET 3.5 SP1 contains four major feature additions (listed). These new features are aimed at enriching the web development and data programmability spaces. Let’s take a moment to examine each of these new features individually…
  • #5: Talking Points: When we talk about the Entity Framework, we’re actually talking about two things: The Entity Data Model (EDM) The Entity Framework It’s important to delineate the two as separate, but complementing technologies The Entity Framework is a set of services that allow you to consume an EDM from within your applications. Object services is a set of classes that allow you to query an EDM and retrieve your results in the form of strongly-typed CLR objects. Entity Client allows you to query an EDM using a traditional ADO.NET paradigm (EntityConnection, EntityDataReader, etc.) Provides a smooth migration path for developers that are new to the Entity Framework Offers performances benefits due to the lack of object materialization Entity SQL is a SQL-like language that let’s you query your EDM with full control. Unlike SQL, Entity SQL queries the conceptual model, so your queries can be expressed in terms of the way your application sees your model, not how your database is actually shaped. LINQ To Entities sits on top of Object Services and allows you to retrieve strongly-typed objects from your EDM, expressed through familiar LINQ query syntax.The Entity Framework is RDMS agnostic, and numerous database vendors are currently developing providers: Oracle, DB2, MySQL, PostgreSQL, VistaDB, SQLite, Sybase, Informix, etc.
  • #6: Estimated Time: 6 minutesTalking Points: When we talk about the Entity Framework, we’re actually talking about two things: The Entity Data Model (EDM) The Entity Framework It’s important to delineate the two as separate, but complementing technologies The EDM is a set of layers that make up your application’s model, as well as it’s mapping to an underlying data store. Made up of three files: CSDL (Conceptual Schema Definition Language) MSL (Mapping Specification Language) SSDL (Storage Schema Definition Language) This separation of concerns allows great flexibility: Model your application the way you want regardless of the state/structure of its underlying data store Normalize your database as much as you need without worrying about affecting the interface of the application’s object model The EDM represents a re-useable application model that can be leveraged from within many applications/environments and persisted across numerous databases. The Entity Data Model is RDMS agnostic, and numerous database vendors are currently developing providers: Oracle, DB2, MySQL, PostgreSQL, VistaDB, SQLite, Sybase, Informix, etc. The Entity Data Model primarily of three main concepts: Entities, which represent your domain objects. Associations, which represent a relationship between two entities. Functions, which represent stored procedures or UDFs in your database that can be mapped to model-level functionality. Because there will be plenty of situations where you’ll need to use stored procedures, the Entity Data Model allows you to map functions in your model to a store procedure in your database. This is useful because you can leverage a stored procedure without having to write ADO.NET code to call it, you can simply call a function on your model. EDM functions are represented as methods on your ObjectContext class.
  • #7: EFConsoleDemoTO DO:Add EDM for Northwind Customers and Orders
  • #8: Estimated Time: 1 minuteTalking Points: Now that we’ve seen the Entity Data Model, let’s see how to work with it using the Entity Framework. The Entity Framework is a set of services that allow you to consume an EDM from within your applications:Entity Client Entity SQL Object Services Entity SQL LINQ To Entities We’ll take a look at the 3 different flavors on consumption in detail, and discuss why and when you would use each one.
  • #9: Estimated Time: 4 minutesTalking Points: The Entity Client is an Entity Framework “port” of the familiar object model of classes used in traditional ADO.NET programming, including:EntityCommandEntityConnectionEntityConnectionStringBuilderEntityDataReaderEntityParameterEntityTransaction Because of this fact it makes it a prime choice for developers migrating to the Entity Framework from ADO.NET. Just like traditional ADO.NET, your queries are returned as sequential text-based data that can iterated over using an EntityDataReader. This is great for performance, but lacks the rich object model that was created as part of your EDM. Entity Client gives you read-only access to your EDM. If data modification is required, you’ll have to use Object Services, which we’ll talk about in a bit. When using Entity Client, your queries are written using Entity SQL, which we’ll talk about in the next slide.
  • #10: Estimated Time: 4 minutesTalking Points: Entity SQL is a query language that is syntactically very similar to SQL, but serves the sole-purpose of querying an EDM. Because it is meant for querying your EDM, this means your queries are written against your conceptual model, not your underlying data store. This higher-level abstraction allows you to write a textual query that is database agnostic. The translation from Entity SQL to T-SQL or PL/SQL (or whatever flavor your underlying data uses), is done by the selected ADO.NET Provider. Here we see a simple example that shows the same query written in T-SQL as well as Entity SQL. Notice that in Entity SQL we don’t have to do any joins, because the notion of relationships are first-class in our conceptual model. As a result, our query is half the size as the T-SQL version. Notice the use of the “Length” function in our Entity SQL example. This is called a “Canonical Function”, which is a high-level abstraction of a database function that will be translated into it’s respective database-specific flavor by your underlying provider
  • #11: Estimated Time: 10 minutesDescription:At this point show some demos that consume the EDM we created in the last demo using Entity Client. Show a few simple queries highlighting some basic Entity SQL.
  • #12: Estimated Time: 5 minutesTalking Points: While the Entity Client API is great and performant, it lacks the use of our created object model, as well as the ability to update data in our model. The Object Services API sits on top of Entity Client, and provides object materialization on top of our queries. This means that instead of getting text-based results, we get back a collection of CLR objects that we can easily work with. The two mains components of the Object Services taxonomy are: ObjectContext, and ObjectQuery&lt;T&gt;ObjectContext is equivalent to an EntityConnection, and is what manages our connection to the EDM as well as provides crucial services for working with our data.ObjectQuery is equivalent to an EntityCommand and represents a single query executed against our EDM, that is manifested back as strongly-typed objects. Object Services allows you to write queries using two flavors: Entity SQL LINQ To Entities The same Entity SQL queries you would write using Entity Client can be leveraged with Object Services, but with the added benefits you get with the higher abstraction level (i.e. object materialization). While Entity SQL is great for scenarios that require a dynamic query, or greater control over your query’s shape, you’re still working with a string that is error-prone. In addition to Entity SQL, Object Services allows you to write your queries against it in LINQ which provides you with strong-typing, error-checking, and a higher level of abstraction from Entity SQL. If you are already familiar with LINQ, then you don’t have to master Entity SQL in order to query an EDM, because LINQ To Entities will make the translation for you. In addition to object materialization, object services provides you with other benefits/services: Unit of work Your Object Context represents your unit of work, which aggregates all changes made to all entities attached/contained in it, so that when you want to push those changes back to the server, you can do so in a single batch. Identity tracking The ObjectContext keeps track of the entities you’ve queried for by key, so that if you later request the same entity (by key), using the same ObjectContext instance, it will return you the instance it already has instead of re-hitting the database. Eager/explicit loading The Entity Framework doesn’t pre-load any relationship properties for you. If you want to query an entity as well as some of it’s related entities, you’ll need to explicitly request that by performing a “span” using the Include method of the ObjectQuery&lt;T&gt; class. Alternatively you can call the Load method on your entity’s relationship property.
  • #13: Estimated Time: 10 minutesDescription: Building upon where we left off at the last demo, show how to make Entity SQL queries using Object Services, retrieving back objects instead of text-based results. Then show how using LINQ To Entities can make querying your EDM even simpler and more intuitive. Show an example of identity tracking, eager loading, and explicit loading. Show some simple examples of modifying data and then saving it back to the database.
  • #14: Estimated Time: 3 minutesTalking Points: This diagram helps to illustrate how each of the Entity Framework’s query options relate to each other. At the core of it all is the database-specific provider. This layer is what translates the query into the SQL flavor required for the underlying data source. Above that is the Entity Client API, which takes the Entity Framework query and passes in down to the database specific provider. If you want to use the Entity Client API directly, you see that you’re only query option is Entity SQL, and because it sits below Object Services, you don’t get any of its benefits. If you want to materialize your queries as objects, and get things like change tracking, identity mapping, relationship loading, etc. then you would use object services, that delegates its queries down to the Entity Client layer. When using Object Services you can leverage both Entity SQL and LINQ to make your queries.
  • #15: Table per type – classic inheritance where separate table contains additional propertiesTable per hierarchy – many types contained in one table and used an indicator flag to indicate the type, table may contain null columns when they have no relevance to type. Situation may occur when table had been de-normalized. Can create many sub-types based on table.Table per concrete type – all information for sub-type in a separate table, e.g. discontinued product information used for reference
  • #19: Estimated Time: 4 minutesTalking Points: Let’s briefly take a look at some common scenarios that services apply. If you develop an AJAX application, the client requests a page and the server returns HTML and JavaScript. At that point all communication happens between the client (JavaScript) and the server. This situation will typically call for a set of services on the server that the client can call using AJAX. In this scenario, the service required for client-server communication is largely data centric, and could look similar to the example we saw in the previous slide [Advance Animation] In a Silverlight application, the server returns the compiled Silverlight app, which then runs on the client’s machine. At that point any client-server communication is done with services. A lot of the services required by the client might be data-centric, at which point we’re in the same situation as we saw in the previous slide [Advance Animation] If you’re creating an online service that is meant to provide data over the cloud, then you’re creating nothing but data access logic, so we’re looking at the same scenario as before [Advance Animation] Finally if you’re creating a mashup, your server returns the UI of the mashup itself, which in turn contains logic for communicating with the data feeds that you’re mashing up. There are many other scenarios that require the use of services, but these exemplify enough the need for services that are largely data-centric. Keep in mind, that there are plenty of scenarios where service functionality that is operational in nature and not data-centric, is also typically required. But in many cases in these scenarios, the common need is data.
  • #20: Estimated Time: 4 minutesTalking Points: Today is we wanted to make a web service using the .NET stack, we could use ASMX or WCF. Both options are great and provide there own level of flexibility and ease-of-use, based on your own familiarity. Imagine we create a service, and initially our service’s purpose is to return a specific customer from a data store [Advance Animation] We simply create a GetCustomer method on our service, and we’re good to go. We later realize that we need to be able to retrieve a list of all customers as well [Advance Animation] We add a GetCustomers method that retrieves all customers, easy enough. We realize that we’ll also have a need to retrieve customers, sorted by a specific field [Advance Animation] We add an overloaded version of GetCustomers that takes an order column. While our service’s functionality is increasing, so is its size. Now we realize that we need to be able to specify the sort direction of the ordered customers we retrieve [Advance Animation] Yet another overloaded version of our GetCustomers method is created. While being able to retrieve all customers is great, the amount of data being transported is too much, so we need to implement a paging mechanism [Advance Animation] Great, now we have paging, and another GetCustomers overloaded. Then we realize we need to be able to apply an arbitrary filter criteria to the method, so we add yet another overload [Advance Animation] So now we have created six methods on our service just to retrieve customer data with ordering, paging, and filtering. What if we later needed address data, and orders made by customers, etc. The amount of code needed to write data access code grows exponentially. Even further, we have only discussed the read operations. What if we later need to have insert, update, and delete methods for customers on our service? Yet more methods added, and more boilerplate code written.
  • #21: Representational State Transfer (REST) is an architectural pattern used in the design of services. REST is about the way in which you expose and make available to callers the contract of the service. REST, therefore, is opposed to SOAP. ADO.NET Data Services’ RESTful interface uses a common URL syntax that clients can learn and leverage across all data services This makes it easy to consume new data services once you’re familiar with the syntax
  • #22: It’s important to note that the “Data” in “Data Services” isn’t referring to a database. A data service is meant to expose data, of any kind over the web, in a standard, and easily consumable fashion. A data service is capable of exposing any object model that contains public properties of type IQueryable&lt;T&gt;. This criteria matches LINQ To SQL, and the Entity Framework, but can just as easily fit a custom object model. Data services implements the Atom Publishing Protocol (AtomPub or APP): Maps HTTP verbs to CRUD operations: GET = Read POST = Create PUT = UpdateDELETE = Delete Exposes the data in the form of Atom feeds and entries
  • #25: http://localhost/AWDataServices/WebDataService.svc/$metadatahttp://localhost/AWDataServices/WebDataService.svc/Producthttp://localhost/AWDataServices/WebDataService.svc/Product(324)http://localhost/AWDataServices/WebDataService.svc/Product(324)/Namehttp://localhost/AWDataServices/WebDataService.svc/Product(324)/Name/$valuehttp://localhost/AWDataServices/WebDataService.svc/ProductSubcategory(2)/Producthttp://localhost/AWDataServices/WebDataService.svc/ProductSubcategory(2)/Product(789)/Namehttp://localhost/AWDataServices/WebDataService.svc/Product?$orderby=Namehttp://localhost/AWDataServices/WebDataService.svc/Product?$filter=Color%20eq%20&apos;Black’http://localhost/AWDataServices/WebDataService.svc/Product?$top=10&amp;$skip=30http://localhost/AWDataServices/WebDataService.svc/ProductSubcategory?$expand=Product
  • #27: Estimated Time: 2 minutesTalking Points: While working with a data service in a browser is great, that doesn’t exactly help accent a client application very much. Because data services have a RESTful interface, you could program against use them using any HTTP stack, such as the HttpWebRequest class in .NET.HttpWebRequest doesn’t offer the rich data platform client functionality that developers might expect, which is why ADO.NET Data Services provides a set of client APIs for working with data services in a more intuitive way: There is a client API for .NET applications as well as Silverlight applications. These allow you to consume a data service from within managed code. There is a new data source control that allows the consumption of a data service using the familiar data source paradigm with an ASP.NET application, that can be easily connected to a GridView, ListView, FormView, or DetailsView. Finally there is a client-side API that allows data service consumption using the ASP.NET AJAX library. With these four client options, you are able to consume a data service from within any .NET application, regardless of the environment.
  • #30: Estimated Time: 3 minutesTalking Points: When using the .NET client API, the DataServiceContext class represents your connection to the data service. The DataServiceContext class provides a lot of functionality around consuming a data service. The arguable two most notable features it provides are: An abstraction layer over the HTTP requests made to the service Object materialization Writing the code required to communicate with a data service using the HttpWebRequest class wouldn’t be that hard, but it would quickly get pretty verbose and time-consuming. Being able to use the DataServiceContext class saves you the effort of working at the HTTP-level completely (there are hooks that let you peer into it if you need to) and allows you to simply request the data you want and let the API handle the plumbing for you. As we saw in our previous examples, the data service returns data in AtomPub format by default, which is great, but would be a pain to have to manually parse in our client application. Fortunately the DataServiceContext class provides full object materialization which translates the returned AtomPub content into CLR objects that we can easily use. The best part about the DataServiceContext’s object materialization is that is doesn’t require the client-side model to match the service-side model at all. As the diagram illustrates, the two-models are completely independent and can to a large degree evolve independently.
  • #37: Talking Points: ASP.NET Routing allows you to define a set of routes that dictate the URL templates your application can respond to, and map them to a handler that can direct the request at the proper resource (i.e. page, controller action method, etc) You can define your routes using both static URLs (/Products/Edit/23) as well as parameterized (/Blog/{year}/{month} /{day}) It is the route handler that is responsible for translating the requested route into an actionable resource than can respond to the request Once you’ve defined your custom route table, you can essentially use it to generate your application’s sitemap. If you know the resource you want, and the parameters it needs, then the ASP.NET Routing engine can generate the proper URL for you based on your route definitions Both ASP.NET MVC and ASP.NET Dynamic Data leverage ASP.NET Routing to enable their custom URL schemes
  • #39: Talking Points: ASP.NET Dynamic Data allows you to specify a data model (EDM, LINQ To SQL, etc) and have an entirely scaffolded web application generated Complete with pages for viewing, adding, editing, and deleting records from each scaffolded entity in your underlying model Each page in the generated application is AJAX-enabled to provide a rich user-experience Each list page provides filtering based on the entity’s foreign-key relationships Your data model can be extended with the new data annotation attributes to add more semantic value to it Add validation to properties within your entity objects: regex, range, required, string length Add metadata to your entities: display column, sort column, display format Define custom data types and associate custom UI templates to entity properties When you create a Dynamic Data application, you get a collection of page templates and field templates, that are used to display your application. Each of these templates can be modified to suit your needs. New templates can also be created. Aside from creating a full-blown dynamic data web application, you can also leverage the dynamic behavior in an existing ASP.NET application, using the standard GridView, ListView, FormView controls you’re already familiar with.
  • #43: Dynamic Data Entities Web ApplicationAdd EDM for Northwind databaseCategoriesProductsSuppliersAdd Data Field Templates
  • #46: Add Dynamic Data Field to Field Templates – IntegerSliderDelete ReadOnly templateAdd UIHint to DataFieldTemplate
  • #47: Estimated Time: 1 minuteTalking Points: In addition to brand new functionality, .NET 3.5 SP1 adds a lot of feature enhancements to existing technologies (listed).
  • #48: As the .NET framework grows and matures, its file size also increases. This large download requirement often poses a problem for clients that don’t have the framework installed. The .NET Framework Client Profile is a new subset of the entire .NET Framework that includes only client-specific assemblies (i.e. WinForms, WPF) and doesn’t contain any of the server-specific assemblies (i.e. LINQ To SQL, Windows Workflow Foundation). The result is a reduced download footprint requirement for client applications that aren’t going to need the extra assemblies anyways. When an application is specifically targetting the .NET Framework Client Profile, Visual Studio will provide compile errors when the application’s code is attempting to use a type that isn’t within an included assembly. The size of the .NET Framework Client Profile is 26mb. A client machine that has the .NET Framework Client Profile can later upgrade to the full version of the .NET Framework if needed.