SlideShare a Scribd company logo
1 of 29
A Clean Repository Pattern In EF
         Via Interfaces
         By Brandon D’Imperio
  Imaginarydevelopment.blogspot.com
What’s wrong?
Typical dependency structure
What’s wrong?
                               We want to move to Azure
Typical dependency structure




                               We want to add a thick client against ADO for
                               our existing web to Azure.
What’s wrong?
                               We want to move to Azure
Typical dependency structure       Persistence change = somewhere
                                   between massive rework to lots of code
                                   adjustments


                               We want to add a thick client against ADO for
                               our existing web to Azure.
                                    UI against multiple data layers=
                                    somewhere between massive rework and
                                    lots of searching for dependencies
We need something more adaptable
• We want to be able to swap out these layers
  with ease, or even on the fly.
What about this?




Dependency-free foundation
How?
• EF layer
  – Entities implement shared interfaces
  – Context implements IRepository<T>
  – T4 for automation
  – Query Interception
     • EF does not allow nor handle IQueryable<T> where T:
       (parent to an Entity)
Code Break
The Visitors are here
Sample Query in EF context
Performance
left join and where
Performance Code
Performance
select and where id> i take(50)



                Straight EF average: 103.811ms
                Intercepted average: 220.3158ms
More Performance
Straight EF Average=1190.3ms
Intercepted Average=1274.43 ms
Domain Layer - How?
• Constructor Injection
• Depends ONLY on the shared interfaces (and
  sometimes DTOs)
• No state, only behavior
Domain Code
Domain Code – public sample
Domain Code – public sample
Domain – Data Layer check-mate
SELECT
[Extent2].[ID] AS [ID],
[Extent2].[DealID] AS [DealID],
[Extent2].[ScenarioNumber] AS [ScenarioNumber],
[Extent2].[ServiceCodeID] AS [ServiceCodeID],
[Extent2].[CountryCode] AS [CountryCode],
[Extent2].[CurrencyCode] AS [CurrencyCode],
[Extent2].[PriceListID] AS [PriceListID],
[Extent2].[BranchID] AS [BranchID],
[Extent2].[ExchangeRate] AS [ExchangeRate],
[Extent2].[Volume] AS [Volume],
[Extent2].[ActualPrice] AS [ActualPrice],
[Extent2].[CurrentPrice] AS [CurrentPrice],
[Extent2].[StandardPrice] AS [StandardPrice],
[Extent2].[MinVol] AS [MinVol],
[Extent2].[MaxVol] AS [MaxVol],
FROM [Treasury].[Deal] AS [Extent1]
INNER JOIN [Treasury].[DealActivity] AS [Extent2] ON [Extent1].[DealID] = [Extent2].[DealID]
WHERE [Extent1].[RegionID] IN (5,1,6,4,2)
UI layer - How?
• Controller requires appropriate Model(s)
• No dependencies on the data layer
UI layer – controller code
Create - post
Delete and Edit
Edit - post
View sample
Create + Edit
Edit scripts
Technologies utilized
• Mvc3 – Now open source! -
  http://aspnet.codeplex.com/
• T4 -
  http://en.wikipedia.org/wiki/Text_Template_
  Transformation_Toolkit
  – T4Mvc - https://t4mvc.codeplex.com/
• Ninject – http://ninject.org
• jQuery - http://jquery.com/
• IQToolkit - http://iqtoolkit.codeplex.com/
References
• Orm speed comparison -
  http://code.google.com/p/dapper-dot-net/
• Open Stackoverflow question -
  http://stackoverflow.com/questions/9422789
  /can-you-program-against-interfaces-in-ef-if-
  you-do-not-make-use-of-navigation-pr
Available SideBar or presentations
• Static Reflection
• A maybe monad in .net
   – http://maybe.codeplex.com
• Unit Testing
   – Asp.net Routing
• T4
   – DTO generation
• Hybrid Winforms/Mvc application
   – Hybrid winforms+mvc pages
• Mvc
   – Inline templates
   – Custom templates

More Related Content

Similar to A clean repository pattern in ef

Devoxx London 2017 - Rethinking Services With Stateful Streams
Devoxx London 2017 - Rethinking Services With Stateful StreamsDevoxx London 2017 - Rethinking Services With Stateful Streams
Devoxx London 2017 - Rethinking Services With Stateful StreamsBen Stopford
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'EnterprisePyCon Italia
 
Accelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and MicroservicesAccelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and MicroservicesAmazon Web Services
 
There is NO CLOUD: For Non-Geeks
There is NO CLOUD: For Non-GeeksThere is NO CLOUD: For Non-Geeks
There is NO CLOUD: For Non-GeeksOpen Spectrum Inc
 
AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019Amazon Web Services
 
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...MSDEVMTL
 
There is NO CLOUD: Geeky Version
There is NO CLOUD: Geeky VersionThere is NO CLOUD: Geeky Version
There is NO CLOUD: Geeky VersionOpen Spectrum Inc
 
Impact 2013 2971 - Fundamental integration and service patterns
Impact 2013 2971 - Fundamental integration and service patternsImpact 2013 2971 - Fundamental integration and service patterns
Impact 2013 2971 - Fundamental integration and service patternsBrian Petrini
 
Build on AWS: Migrating and Platforming
Build on AWS: Migrating and PlatformingBuild on AWS: Migrating and Platforming
Build on AWS: Migrating and PlatformingAmazon Web Services
 
Why NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB AtlasWhy NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB AtlasDatavail
 
Event Driven Services Part 1: The Data Dichotomy
Event Driven Services Part 1: The Data Dichotomy Event Driven Services Part 1: The Data Dichotomy
Event Driven Services Part 1: The Data Dichotomy Ben Stopford
 
The Data Dichotomy- Rethinking the Way We Treat Data and Services
The Data Dichotomy- Rethinking the Way We Treat Data and ServicesThe Data Dichotomy- Rethinking the Way We Treat Data and Services
The Data Dichotomy- Rethinking the Way We Treat Data and Servicesconfluent
 
An introduction to AWS Direct Connect
An introduction to AWS Direct ConnectAn introduction to AWS Direct Connect
An introduction to AWS Direct ConnectJulien SIMON
 
Strata Software Architecture NY: The Data Dichotomy
Strata Software Architecture NY: The Data DichotomyStrata Software Architecture NY: The Data Dichotomy
Strata Software Architecture NY: The Data DichotomyBen Stopford
 

Similar to A clean repository pattern in ef (20)

Devoxx London 2017 - Rethinking Services With Stateful Streams
Devoxx London 2017 - Rethinking Services With Stateful StreamsDevoxx London 2017 - Rethinking Services With Stateful Streams
Devoxx London 2017 - Rethinking Services With Stateful Streams
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'Enterprise
 
Accelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and MicroservicesAccelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and Microservices
 
There is NO CLOUD: For Non-Geeks
There is NO CLOUD: For Non-GeeksThere is NO CLOUD: For Non-Geeks
There is NO CLOUD: For Non-Geeks
 
Lets focus on business value
Lets focus on business valueLets focus on business value
Lets focus on business value
 
Lets focus on business value
Lets focus on business valueLets focus on business value
Lets focus on business value
 
Mini-Track: Lessons from Public Cloud
Mini-Track: Lessons from Public CloudMini-Track: Lessons from Public Cloud
Mini-Track: Lessons from Public Cloud
 
JAX London Slides
JAX London SlidesJAX London Slides
JAX London Slides
 
AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019
 
04 managing the database
04   managing the database04   managing the database
04 managing the database
 
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
 
There is NO CLOUD: Geeky Version
There is NO CLOUD: Geeky VersionThere is NO CLOUD: Geeky Version
There is NO CLOUD: Geeky Version
 
Impact 2013 2971 - Fundamental integration and service patterns
Impact 2013 2971 - Fundamental integration and service patternsImpact 2013 2971 - Fundamental integration and service patterns
Impact 2013 2971 - Fundamental integration and service patterns
 
AWS vs. Azure
AWS vs. AzureAWS vs. Azure
AWS vs. Azure
 
Build on AWS: Migrating and Platforming
Build on AWS: Migrating and PlatformingBuild on AWS: Migrating and Platforming
Build on AWS: Migrating and Platforming
 
Why NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB AtlasWhy NBC Universal Migrated to MongoDB Atlas
Why NBC Universal Migrated to MongoDB Atlas
 
Event Driven Services Part 1: The Data Dichotomy
Event Driven Services Part 1: The Data Dichotomy Event Driven Services Part 1: The Data Dichotomy
Event Driven Services Part 1: The Data Dichotomy
 
The Data Dichotomy- Rethinking the Way We Treat Data and Services
The Data Dichotomy- Rethinking the Way We Treat Data and ServicesThe Data Dichotomy- Rethinking the Way We Treat Data and Services
The Data Dichotomy- Rethinking the Way We Treat Data and Services
 
An introduction to AWS Direct Connect
An introduction to AWS Direct ConnectAn introduction to AWS Direct Connect
An introduction to AWS Direct Connect
 
Strata Software Architecture NY: The Data Dichotomy
Strata Software Architecture NY: The Data DichotomyStrata Software Architecture NY: The Data Dichotomy
Strata Software Architecture NY: The Data Dichotomy
 

More from MaslowB

F# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioF# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioMaslowB
 
Knockout vs. angular
Knockout vs. angularKnockout vs. angular
Knockout vs. angularMaslowB
 
Js testing
Js testingJs testing
Js testingMaslowB
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolatorMaslowB
 
What’s new mvc 4
What’s new mvc 4What’s new mvc 4
What’s new mvc 4MaslowB
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolatorMaslowB
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentationMaslowB
 
Metaprogramming by brandon
Metaprogramming by brandonMetaprogramming by brandon
Metaprogramming by brandonMaslowB
 

More from MaslowB (9)

F# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperioF# for BLOBA, by brandon d'imperio
F# for BLOBA, by brandon d'imperio
 
Knockout vs. angular
Knockout vs. angularKnockout vs. angular
Knockout vs. angular
 
Js testing
Js testingJs testing
Js testing
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolator
 
What’s new mvc 4
What’s new mvc 4What’s new mvc 4
What’s new mvc 4
 
Metrics
MetricsMetrics
Metrics
 
Type mock isolator
Type mock isolatorType mock isolator
Type mock isolator
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 
Metaprogramming by brandon
Metaprogramming by brandonMetaprogramming by brandon
Metaprogramming by brandon
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

A clean repository pattern in ef

  • 1. A Clean Repository Pattern In EF Via Interfaces By Brandon D’Imperio Imaginarydevelopment.blogspot.com
  • 3. What’s wrong? We want to move to Azure Typical dependency structure We want to add a thick client against ADO for our existing web to Azure.
  • 4. What’s wrong? We want to move to Azure Typical dependency structure Persistence change = somewhere between massive rework to lots of code adjustments We want to add a thick client against ADO for our existing web to Azure. UI against multiple data layers= somewhere between massive rework and lots of searching for dependencies
  • 5. We need something more adaptable • We want to be able to swap out these layers with ease, or even on the fly.
  • 7. How? • EF layer – Entities implement shared interfaces – Context implements IRepository<T> – T4 for automation – Query Interception • EF does not allow nor handle IQueryable<T> where T: (parent to an Entity)
  • 10. Sample Query in EF context
  • 13. Performance select and where id> i take(50) Straight EF average: 103.811ms Intercepted average: 220.3158ms
  • 14. More Performance Straight EF Average=1190.3ms Intercepted Average=1274.43 ms
  • 15. Domain Layer - How? • Constructor Injection • Depends ONLY on the shared interfaces (and sometimes DTOs) • No state, only behavior
  • 17. Domain Code – public sample
  • 18. Domain Code – public sample
  • 19. Domain – Data Layer check-mate SELECT [Extent2].[ID] AS [ID], [Extent2].[DealID] AS [DealID], [Extent2].[ScenarioNumber] AS [ScenarioNumber], [Extent2].[ServiceCodeID] AS [ServiceCodeID], [Extent2].[CountryCode] AS [CountryCode], [Extent2].[CurrencyCode] AS [CurrencyCode], [Extent2].[PriceListID] AS [PriceListID], [Extent2].[BranchID] AS [BranchID], [Extent2].[ExchangeRate] AS [ExchangeRate], [Extent2].[Volume] AS [Volume], [Extent2].[ActualPrice] AS [ActualPrice], [Extent2].[CurrentPrice] AS [CurrentPrice], [Extent2].[StandardPrice] AS [StandardPrice], [Extent2].[MinVol] AS [MinVol], [Extent2].[MaxVol] AS [MaxVol], FROM [Treasury].[Deal] AS [Extent1] INNER JOIN [Treasury].[DealActivity] AS [Extent2] ON [Extent1].[DealID] = [Extent2].[DealID] WHERE [Extent1].[RegionID] IN (5,1,6,4,2)
  • 20. UI layer - How? • Controller requires appropriate Model(s) • No dependencies on the data layer
  • 21. UI layer – controller code
  • 27. Technologies utilized • Mvc3 – Now open source! - http://aspnet.codeplex.com/ • T4 - http://en.wikipedia.org/wiki/Text_Template_ Transformation_Toolkit – T4Mvc - https://t4mvc.codeplex.com/ • Ninject – http://ninject.org • jQuery - http://jquery.com/ • IQToolkit - http://iqtoolkit.codeplex.com/
  • 28. References • Orm speed comparison - http://code.google.com/p/dapper-dot-net/ • Open Stackoverflow question - http://stackoverflow.com/questions/9422789 /can-you-program-against-interfaces-in-ef-if- you-do-not-make-use-of-navigation-pr
  • 29. Available SideBar or presentations • Static Reflection • A maybe monad in .net – http://maybe.codeplex.com • Unit Testing – Asp.net Routing • T4 – DTO generation • Hybrid Winforms/Mvc application – Hybrid winforms+mvc pages • Mvc – Inline templates – Custom templates

Editor's Notes

  1. IRepository, Entity Framework, T4, Front-To-Back
  2. Ask for input, what difficulties could this structure cause?
  3. Linq to Entities, vs. Linq to Objects, vs. Linq to Azure?
  4. Linq to Entities, vs. Linq to Objects, vs. Linq to Azure?
  5. Mark Seemann - http://blog.ploeh.dk/
  6. When I serialized out an entity, properties that were non-poco came with. Translate anonymous types in this layer
  7. Does not rely on model directly – sample for ideas, not completely clean