4. Basic ASP.NET MVC Programming
NuGet Package Manager
Entity Framework 4.x Code First Introduce
EF Migration
Deep in Model
Deep in Controller
Deep in View
UI JavaScript Framework
Application Layer Architecture
Repository Pattern
Dependency Injection
Security
ASP.NET MVC 4 Preview
5. Model :
o Class Model
o Entity Model
o Domain Transfer Object (DTO)
o View Model
View : User Interface
o Engine : ASPX ViewEngine, Razor ViewEngine, Etc……
o Output: HTML, CSS, JavaScript, JSON, Text
Controller
o Control logic,
o Data access,
o Prepare parameters for view render
o call view to render output
9. Manage Library 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 Solution->Project -> right click on +Reference -> nuget package
o Package Manager Console
• Install-Package <package name>
• Uninstall-Package <package name>
• Get-Package
• Update-Package //all available
11. Object Relational Mapping
POCO
Convention Over Configuration
LINQ Support
Working with various database (3rd party driver)
Fluent API to fully customize the persistence mapping
Database Installation
Database Migration
13. Model?
o Rich Domain?
o Model Entity?
o DTO?
Validation?
o Server Side
• DataAnotation Attribute
• IValidationObject
• FluentValidate
o Client Side
• ClientValidation
• IClientValidatable
Demo
18. 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
20. 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.
23. 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!
25. Windows Authentication
Form Authentication
Asp.net Membership Provider
Controller and Action
o Authorize Attribute
o FluentSecurity (robust, fluent syntax)
26. New Default project templates
New mobile project template
Recipes to customize code generation
Asynchronous methods