SlideShare une entreprise Scribd logo
1  sur  22
ASP.NET MVC
Practice and Guideline
Zubzib Black Coffee #7
About me
                      • Chalermpon Areepong (Nine)




 • Microsoft MVP ASP.NET




 • Work @
Session Level 300
Audience Skill
• HTML
• JavaScript
• C#
• OOP
• LINQ
Agenda
• Basic ASP.NET MVC Programming
    o   Model
    o   View
    o   Controller
    o   Routes

•   NuGet Package Manager
•   Entity Framework 4.x Code First Introduce
•   Application Layer Architecture
•   Repository Pattern
•   Dependency Injection
Basic of ASP.NET MVC
Programing
• Model :
   o Class Model, Domain Transfer Object (DTO), View Model
   o Model Validation
      • Validation Attribute, IValidationObject Interface

• View : User Interface
   o Engine : ASPX ViewEngine, Razor ViewEngine, Etc……
   o HTML, CSS, JavaScript

• Controller
   o   Control logic,
   o   Data access,
   o   Prepare parameters for view render
   o   call view to render output
Basic of ASP.NET MVC
Programing
• DEMO
Basic of ASP.NET MVC
 Programing
• Routes
  o Catch URL to parameter by pattern
     • Default
               “{controller}/{action}/{id}”
               http://www.zz.com/blog/get/1
     • Fix route value
               new { controller = “blog”, action = “get”, id = 1 }
     • Custom Routes
          o blog/Archive/12-25-2009
               “{controller}/{action}/{date}”
               http://www.zz.com/blog/Archive/12-25-2009
               Public ActionResult Archive(DateTime date)
          o blog/Archive/12-25-2009_12-17-2011
               “{controller}/{action}/{dateFrom}_{dateTo}”
               http://www.zz.com/blog/Archive/12-25-2009_12-17-2011
               public ActionResult Archive(DateTime dateFrom, DateTime DateTo)
Basic of ASP.NET MVC
 Programing
• Routes DEMO
NuGet Package Manager
• Library Utility for
   o Search
   o Install / Update / Uninstall
   o Execute library command (PowerShell)

• VS - > Menu -> Tools -> Extension Manager -> Find
  NuGet and install
• How to use
   o Project Reference
   o Package Manager Console
       • Install-Package <package name>
       • Uninstall-Package <package name>
       • Get-Package
NuGet Package Manager
• DEMO
EF 4.x Code First
•   Object Relational Mapping
•   POCO
•   Convention Over Configuration
•   LINQ Support
•   Working with various database (3rd party driver)
•   Fluent API to fully customize the persistence
    mapping

• Demo…..
EF 4.x Code First
• DEMO
MVC UI Library
All will render to HTML/ CSS / JavaScript
• JQuery UI
• Telerik MVC Extension (current not full support
   HTML5)
• Knockout (MVVM)
• Kendo UI (HTML5)
• Wijmo (HTML5)
MVC UI Library
• DEMO
Software Design:
Repository Pattern
• Encapsulate data access
• Simple collection like interface
• Should only return aggregate roots
• Provide for adding and removing entities
• Provide methods to select objects based on some
  criteria
• Allow easy substitution
Software Design:
Repository Pattern
• DEMO
Software Design:
Core Layer Architecture
Motivation – Logical layers separate the major
concerns of the application:
• 1. Modularity, low-coupling – easier maintenance.
• 2. Business-logic is separated from presentation –
  reuse.
• 3. General technical services, e.g., database, are
  separated from the business-logic –
  reused, replaced.
• 4. Low coupling, separation of concerns – evolving
  functionality, system scaling-up, adapt to new
  technologies.
Software Design:
Core Layer Architecture
Software Design:
Core Layer Architecture
• DEMO
Dependency Injection
• Dependency Injection - one example of IoC design
  principle.
• Also known as the Hollywood Principle
   o Don’t call us, we’ll call you!
• Good OO Systems – organised as web of interacting
  objects

• Goal – High cohesion, low coupling
• Advantages of low coupling
   o Extensibility
   o Testability
   o Reusability


PS>Not so easy to achieve!
Dependency Injection
• Demo
Summary
•   ASP.NET MVC
•   NuGet
•   EF Code First
•   JavaScript Framework
•   AutoFac MVC Integration

• Bye…

Contenu connexe

Tendances

[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile appsIvano Malavolta
 
Beyond PrettyFaces - Einführung in Rewrite
Beyond PrettyFaces - Einführung in RewriteBeyond PrettyFaces - Einführung in Rewrite
Beyond PrettyFaces - Einführung in RewriteChristian Kaltepoth
 
Alex Thissen "Server-less compute with .NET based Azure Functions"
Alex Thissen "Server-less compute with .NET based Azure Functions"Alex Thissen "Server-less compute with .NET based Azure Functions"
Alex Thissen "Server-less compute with .NET based Azure Functions"Fwdays
 
[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JSIvano Malavolta
 
Everything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 minEverything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 minEdgar Parada
 
Beyond PrettyFaces - Einführung in Rewrite
Beyond PrettyFaces - Einführung in RewriteBeyond PrettyFaces - Einführung in Rewrite
Beyond PrettyFaces - Einführung in RewriteChristian Kaltepoth
 
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...Sencha
 
Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationGunnar Hillert
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!Muhammad Ghazali
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQAvijit Shaw
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETAlan Hecht
 
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js PlatformNaresh Chintalcheru
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsSoós Gábor
 

Tendances (20)

AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps
 
Zend framework 02 - mvc
Zend framework 02 - mvcZend framework 02 - mvc
Zend framework 02 - mvc
 
Beyond PrettyFaces - Einführung in Rewrite
Beyond PrettyFaces - Einführung in RewriteBeyond PrettyFaces - Einführung in Rewrite
Beyond PrettyFaces - Einführung in Rewrite
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Alex Thissen "Server-less compute with .NET based Azure Functions"
Alex Thissen "Server-less compute with .NET based Azure Functions"Alex Thissen "Server-less compute with .NET based Azure Functions"
Alex Thissen "Server-less compute with .NET based Azure Functions"
 
[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS[2015/2016] Require JS and Handlebars JS
[2015/2016] Require JS and Handlebars JS
 
Everything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 minEverything you need to know about HTML5 in 15 min
Everything you need to know about HTML5 in 15 min
 
Beyond PrettyFaces - Einführung in Rewrite
Beyond PrettyFaces - Einführung in RewriteBeyond PrettyFaces - Einführung in Rewrite
Beyond PrettyFaces - Einführung in Rewrite
 
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
 
Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring Integration
 
AngularJS
AngularJSAngularJS
AngularJS
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!
 
ASP .NET MVC - best practices
ASP .NET MVC - best practicesASP .NET MVC - best practices
ASP .NET MVC - best practices
 
.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ.NET,ASP .NET, Angular Js,LinQ
.NET,ASP .NET, Angular Js,LinQ
 
Codeinator
CodeinatorCodeinator
Codeinator
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NET
 
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js Platform
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
 

Similaire à ZZ BC#7 asp.net mvc practice and guideline by NineMvp

2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5Daniel Fisher
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelAlex Thissen
 
SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5Jon Galloway
 
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Dot Net Tricks
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Sitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayoutsSitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayoutsnonlinear creations
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5mbaric
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesVagif Abilov
 
CFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful CodeCFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful Codeindiver
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantNitin Sawant
 

Similaire à ZZ BC#7 asp.net mvc practice and guideline by NineMvp (20)

2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
 
SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5
 
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
Introduction Asp.Net MVC5 |MVC5 Tutorial for Beginners & Advanced | Dot Net T...
 
Plantilla oracle
Plantilla oraclePlantilla oracle
Plantilla oracle
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Sitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayoutsSitecore MVC: Converting Web Forms sublayouts
Sitecore MVC: Converting Web Forms sublayouts
 
Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
 
Asp 1a-aspnetmvc
Asp 1a-aspnetmvcAsp 1a-aspnetmvc
Asp 1a-aspnetmvc
 
Aspnetmvc 1
Aspnetmvc 1Aspnetmvc 1
Aspnetmvc 1
 
Ow
OwOw
Ow
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
CFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful CodeCFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful Code
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
Ow
OwOw
Ow
 
Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 

Plus de Chalermpon Areepong

Web API authentication and authorization
Web API authentication and authorization Web API authentication and authorization
Web API authentication and authorization Chalermpon Areepong
 
Build your website with angularjs and web apis
Build your website with angularjs and web apisBuild your website with angularjs and web apis
Build your website with angularjs and web apisChalermpon Areepong
 
ZZ BC#8 Hello ASP.NET MVC 4 (dks)
ZZ BC#8 Hello ASP.NET MVC 4 (dks)ZZ BC#8 Hello ASP.NET MVC 4 (dks)
ZZ BC#8 Hello ASP.NET MVC 4 (dks)Chalermpon Areepong
 
Build your web app with asp.net mvc 2 from scratch
Build your web app with asp.net mvc 2 from scratchBuild your web app with asp.net mvc 2 from scratch
Build your web app with asp.net mvc 2 from scratchChalermpon Areepong
 

Plus de Chalermpon Areepong (9)

DevRock #02 akka.net intro part
DevRock #02 akka.net intro partDevRock #02 akka.net intro part
DevRock #02 akka.net intro part
 
Web API authentication and authorization
Web API authentication and authorization Web API authentication and authorization
Web API authentication and authorization
 
Build your website with angularjs and web apis
Build your website with angularjs and web apisBuild your website with angularjs and web apis
Build your website with angularjs and web apis
 
Java script for web developer
Java script for web developerJava script for web developer
Java script for web developer
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
ZZ BC#8 Hello ASP.NET MVC 4 (dks)
ZZ BC#8 Hello ASP.NET MVC 4 (dks)ZZ BC#8 Hello ASP.NET MVC 4 (dks)
ZZ BC#8 Hello ASP.NET MVC 4 (dks)
 
Build your web app with asp.net mvc 2 from scratch
Build your web app with asp.net mvc 2 from scratchBuild your web app with asp.net mvc 2 from scratch
Build your web app with asp.net mvc 2 from scratch
 
Gf vtzz-05--j queryshowcase
Gf vtzz-05--j queryshowcaseGf vtzz-05--j queryshowcase
Gf vtzz-05--j queryshowcase
 
J query
J queryJ query
J query
 

Dernier

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Dernier (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

ZZ BC#7 asp.net mvc practice and guideline by NineMvp

  • 1. ASP.NET MVC Practice and Guideline Zubzib Black Coffee #7
  • 2. About me • Chalermpon Areepong (Nine) • Microsoft MVP ASP.NET • Work @
  • 3. Session Level 300 Audience Skill • HTML • JavaScript • C# • OOP • LINQ
  • 4. Agenda • Basic ASP.NET MVC Programming o Model o View o Controller o Routes • NuGet Package Manager • Entity Framework 4.x Code First Introduce • Application Layer Architecture • Repository Pattern • Dependency Injection
  • 5. Basic of ASP.NET MVC Programing • Model : o Class Model, Domain Transfer Object (DTO), View Model o Model Validation • Validation Attribute, IValidationObject Interface • View : User Interface o Engine : ASPX ViewEngine, Razor ViewEngine, Etc…… o HTML, CSS, JavaScript • Controller o Control logic, o Data access, o Prepare parameters for view render o call view to render output
  • 6. Basic of ASP.NET MVC Programing • DEMO
  • 7. Basic of ASP.NET MVC Programing • Routes o Catch URL to parameter by pattern • Default “{controller}/{action}/{id}” http://www.zz.com/blog/get/1 • Fix route value new { controller = “blog”, action = “get”, id = 1 } • Custom Routes o blog/Archive/12-25-2009 “{controller}/{action}/{date}” http://www.zz.com/blog/Archive/12-25-2009 Public ActionResult Archive(DateTime date) o blog/Archive/12-25-2009_12-17-2011 “{controller}/{action}/{dateFrom}_{dateTo}” http://www.zz.com/blog/Archive/12-25-2009_12-17-2011 public ActionResult Archive(DateTime dateFrom, DateTime DateTo)
  • 8. Basic of ASP.NET MVC Programing • Routes DEMO
  • 9. NuGet Package Manager • Library Utility for o Search o Install / Update / Uninstall o Execute library command (PowerShell) • VS - > Menu -> Tools -> Extension Manager -> Find NuGet and install • How to use o Project Reference o Package Manager Console • Install-Package <package name> • Uninstall-Package <package name> • Get-Package
  • 11. EF 4.x Code First • Object Relational Mapping • POCO • Convention Over Configuration • LINQ Support • Working with various database (3rd party driver) • Fluent API to fully customize the persistence mapping • Demo…..
  • 12. EF 4.x Code First • DEMO
  • 13. MVC UI Library All will render to HTML/ CSS / JavaScript • JQuery UI • Telerik MVC Extension (current not full support HTML5) • Knockout (MVVM) • Kendo UI (HTML5) • Wijmo (HTML5)
  • 15. Software Design: Repository Pattern • Encapsulate data access • Simple collection like interface • Should only return aggregate roots • Provide for adding and removing entities • Provide methods to select objects based on some criteria • Allow easy substitution
  • 17. Software Design: Core Layer Architecture Motivation – Logical layers separate the major concerns of the application: • 1. Modularity, low-coupling – easier maintenance. • 2. Business-logic is separated from presentation – reuse. • 3. General technical services, e.g., database, are separated from the business-logic – reused, replaced. • 4. Low coupling, separation of concerns – evolving functionality, system scaling-up, adapt to new technologies.
  • 19. Software Design: Core Layer Architecture • DEMO
  • 20. Dependency Injection • Dependency Injection - one example of IoC design principle. • Also known as the Hollywood Principle o Don’t call us, we’ll call you! • Good OO Systems – organised as web of interacting objects • Goal – High cohesion, low coupling • Advantages of low coupling o Extensibility o Testability o Reusability PS>Not so easy to achieve!
  • 22. Summary • ASP.NET MVC • NuGet • EF Code First • JavaScript Framework • AutoFac MVC Integration • Bye…