SlideShare a Scribd company logo
ASP.NET: Building Web Application… in the right way
ASP.NET a brief history
• 2001 – first release
• 2009 – ASP.NET MVC
• 2012 – ASP.NET Web API
• 2013 – OWIN and SignalR
• 2015 – ASP.NET 5 (RC1)
MVC pattern
notifies
Controller
Model
View
interacts
with
modifies
modifies
listens /
gets data from
MVC web style
Webpageinteracts
with
Controller
Model
View
selects a
passes a model to
acts on
gets data fromproduces
invokes
ASP.NET MVC
• A new presentation option for ASP.NET
• Simpler way to program ASP.NET
• Easily testable and TDD friendly
• More control over your <html/>
• More control over your URLs
• Supports existing ASP.NET features
• Removes: viewstate and postback needs
Routing
Webpageinteracts
with
Controller
Model
View
selects a
passes a model to
acts on
gets data fromproduces
invokes
Routing - example
public class OrdersController : Controller
{
public ActionResult Index()
{
}
public ActionResult Details(int id)
{
}
}
http://www.yoursite.com/Orders/Details/1
Routing - example
http://www.yoursite.com/Orders/Details/1
public class OrdersController : Controller
{
public ActionResult Index()
{
}
public ActionResult Details(int id)
{
}
}
Routing - example
http://www.yoursite.com/Orders/Details/1
public class OrdersController : Controller
{
public ActionResult Index()
{
}
public ActionResult Details(int id)
{
}
}
Routing – configuration
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home",
action = "Index", id = UrlParameter.Optional });
}
Routing – configuration
routes.MapMvcAttributeRoutes();
//
public class OrdersController : Controller
{
[Route("Orders/{id}/Items")]
public ActionResult OrderItems(int id)
{
}
}
http://www.yoursite.com/Orders/1/Items
Controller
Webpageinteracts
with
Controller
Model
View
selects a
passes a model to
acts on
gets data fromproduces
invokes
Controller
public class OrdersController : Controller
{
public ActionResult Details(int? id)
{
Order order = db.Orders.Find(id);
if (order == null)
return HttpNotFound();
return View(order);
}
}
View("MyWonderfulOrderView", order);
Controller – routing and HTTP methods
public class OrdersController : Controller
{
// GET: Orders/Edit/5
public ActionResult Edit(int? id)
{
}
// POST: Orders/Edit/5
[HttpPost]
public ActionResult Edit(Order order)
{
}
}
Model
Webpageinteracts
with
Controller
Model
View
selects a
passes a model to
acts on
gets data fromproduces
invokes
Model
• View Model or Business Model
• Validation attributes, for example:
• Required
• EmailAddress
• StringLength
• View-related attributes, e.g. Display
public class LoginViewModel
{
[Required]
[Display(Name = "Email address")]
[EmailAddress]
public string Email { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Remember me")]
public bool RememberMe { get; set; }
}
View
Webpageinteracts
with
Controller
Model
View
selects a
passes a model to
acts on
gets data fromproduces
invokes
View
• Related to controllers/actions by naming convetion
• Several View Engine. Standard: Razor, WebFormViewEngine
• Support layouts and partial views
• Can use strongly-typed model (e.g. Order) or dynamic one (ViewBag)
• @Html helper methods (e.g. @Html.TextBoxFor)
• @Html methods can be extended
ActionResult
• ActionResult is the base class for action’s return types
• Available results:
• ViewResult - Renders a specifed view to the response stream
• RedirectResult - Performs an HTTP redirection to a specifed URL
• RedirectToRouteResult - Performs an HTTP redirection to a URL that is determined by
the routing engine, based on given route data
• JsonResult - Serializes a given ViewData object to JSON format
• ContentResult - Writes content to the response stream without requiring a view
• FileContentResult - Returns a file to the client
• and more
Model binder
• Transform values from client to .NET class instances or primitive types
• Retrieves values from HTML form variables, POSTed variables, query string
and routing parameters
• DefaultModelBinder is the default binder
• Binding can be customized, for specific types at application level or at action’s
parameter level
Filters
• Enable Aspect Oriented Programming (AOP)
• Different types for different needs:
• Authorization filters – IAuthorizationFilter
• Action filters – IActionFilter
• Result filters – IResultFilter
• Exception filters – IExceptionFilter
• Filters can be applied to a single action or a whole controller
Q&A
Q&A
ASP.NET Web API
• Formerly part of WCF framework
• 2012 – First release
• 2013 – Release of Web API 2
• First class framework for HTTP-based services
• Foundamental for creating RESTful services
• Self-hosted
• Different stacks, same concepts – System.Web.Mvc  System.Web.Http
ASP.NET Web API cf. MVC
• Similar route patterns declarations
• Request/method name matching by HTTP verbs
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
ASP.NET Web API cf. MVC
GET http://www.yoursite.com/api/Orders/5
public class OrdersController : ApiController
{
IQueryable<Order> GetOrders() { … }
IHttpActionResult GetOrder(int id) { … }
IHttpActionResult PutOrder(int id, Order order) { … }
IHttpActionResult PostOrder(Order order) { … }
IHttpActionResult DeleteOrder(int id) { … }
}
ASP.NET Web API cf. MVC
• No views or ActionResult just data or IHttpActionResult
• Data are serialized in JSON or other format (e.g. XML)
• Controllers inherit from ApiController
• No more HttpContext.Current
• View filters
ASP.NET Web API - OData
“An open protocol to allow the creation and consumption of queryable and
interoperable RESTful APIs in a simple and standard way”
EnableQueryAttribute
Implements out of the box most of the OData query system: filters, pagination,
projection, etc.
Let’s go to code
Let’s go to code
Q&A
Q&A
What’s next? ASP.NET 5
ASP.NET 5 – .NET Core
• Totally modular
• Faster development cycle
• Seamless transition from on-premises to cloud
• Choose your editor and tools
• Open-source
• Cross-platform
• Fast
ASP.NET 5 cf. ASP.NET 4.X
• No more Web Forms and Web API only MVC
• One ring stack to rule them all, i.e. no more double coding
• Tag helpers – cleaner HTML views
• Project and configuration files in JSON
• Server side and client side packages completelly decoupled
• much more 
thank you for your attention
stay tuned for next workshops
Andrea Vallotti, ph.D
andrea.vallotti@commitsoftware.it

More Related Content

What's hot

Building dynamic applications with the share point client object model
Building dynamic applications with the share point client object modelBuilding dynamic applications with the share point client object model
Building dynamic applications with the share point client object modelEric Shupps
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
Santosh Kumar Kar
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.netBhumivaghasiya
 
Standard List Controllers
Standard List Controllers Standard List Controllers
Standard List Controllers
Mohammed Safwat Abu Kwaik
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentation
manolitto
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Nir Elbaz
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
Igor Talevski
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controlsRaed Aldahdooh
 
Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014
manolitto
 
Asp.net mvc 6 with sql server 2014
Asp.net mvc 6 with sql server 2014Asp.net mvc 6 with sql server 2014
Asp.net mvc 6 with sql server 2014
Fahim Faysal Kabir
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
Reshi Unen
 
Sitecore MVC (User Group Conference, May 23rd 2014)
Sitecore MVC (User Group Conference, May 23rd 2014)Sitecore MVC (User Group Conference, May 23rd 2014)
Sitecore MVC (User Group Conference, May 23rd 2014)
Ruud van Falier
 
Asp.Net MVC
Asp.Net MVCAsp.Net MVC
Asp.Net MVC
Sudheesh Valathil
 
Tech Talk Live on Share Extensibility
Tech Talk Live on Share ExtensibilityTech Talk Live on Share Extensibility
Tech Talk Live on Share Extensibility
Alfresco Software
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to Visualforce
Sujit Kumar
 
Getting a Quick Start with Visualforce
Getting a Quick Start with Visualforce Getting a Quick Start with Visualforce
Getting a Quick Start with Visualforce
Mohammed Safwat Abu Kwaik
 
Advance java session 15
Advance java session 15Advance java session 15
Advance java session 15
Smita B Kumar
 

What's hot (20)

Building dynamic applications with the share point client object model
Building dynamic applications with the share point client object modelBuilding dynamic applications with the share point client object model
Building dynamic applications with the share point client object model
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 
Standard List Controllers
Standard List Controllers Standard List Controllers
Standard List Controllers
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentation
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
 
Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014
 
Asp.net mvc 6 with sql server 2014
Asp.net mvc 6 with sql server 2014Asp.net mvc 6 with sql server 2014
Asp.net mvc 6 with sql server 2014
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
 
Sitecore MVC (User Group Conference, May 23rd 2014)
Sitecore MVC (User Group Conference, May 23rd 2014)Sitecore MVC (User Group Conference, May 23rd 2014)
Sitecore MVC (User Group Conference, May 23rd 2014)
 
Asp.Net MVC
Asp.Net MVCAsp.Net MVC
Asp.Net MVC
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
Tech Talk Live on Share Extensibility
Tech Talk Live on Share ExtensibilityTech Talk Live on Share Extensibility
Tech Talk Live on Share Extensibility
 
SFDC UI - Introduction to Visualforce
SFDC UI -  Introduction to VisualforceSFDC UI -  Introduction to Visualforce
SFDC UI - Introduction to Visualforce
 
Getting a Quick Start with Visualforce
Getting a Quick Start with Visualforce Getting a Quick Start with Visualforce
Getting a Quick Start with Visualforce
 
Ajax
AjaxAjax
Ajax
 
Standard control in asp.net
Standard control in asp.netStandard control in asp.net
Standard control in asp.net
 
Advance java session 15
Advance java session 15Advance java session 15
Advance java session 15
 

Viewers also liked

02 Introduction to Javascript
02 Introduction to Javascript02 Introduction to Javascript
02 Introduction to Javascriptcrgwbr
 
Javascript
JavascriptJavascript
Javascript
atozknowledge .com
 
Building Applications Using Ajax
Building Applications Using AjaxBuilding Applications Using Ajax
Building Applications Using Ajax
s_pradeep
 
Html5(2)
Html5(2)Html5(2)
Html5(2)
Carol Maughan
 
INFT132 093 07 Document Object Model
INFT132 093 07 Document Object ModelINFT132 093 07 Document Object Model
INFT132 093 07 Document Object Model
Michael Rees
 
introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5
FLYMAN TECHNOLOGY LIMITED
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
Partnered Health
 
3.jsp tutorial
3.jsp tutorial3.jsp tutorial
3.jsp tutorialshiva404
 
Document object model
Document object modelDocument object model
Document object model
Amit kumar
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
yht4ever
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
Mindy McAdams
 
Introduction To Building Enterprise Web Application With Spring Mvc
Introduction To Building Enterprise Web Application With Spring MvcIntroduction To Building Enterprise Web Application With Spring Mvc
Introduction To Building Enterprise Web Application With Spring Mvc
Abdelmonaim Remani
 
Document object model(dom)
Document object model(dom)Document object model(dom)
Document object model(dom)
rahul kundu
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
Chitrank Dixit
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
FAKHRUN NISHA
 
Building Web Application Using Spring Framework
Building Web Application Using Spring FrameworkBuilding Web Application Using Spring Framework
Building Web Application Using Spring Framework
Edureka!
 
Open Source Technology
Open Source TechnologyOpen Source Technology
Open Source Technology
priyadharshini murugan
 

Viewers also liked (20)

02 Introduction to Javascript
02 Introduction to Javascript02 Introduction to Javascript
02 Introduction to Javascript
 
Javascript
JavascriptJavascript
Javascript
 
Building Applications Using Ajax
Building Applications Using AjaxBuilding Applications Using Ajax
Building Applications Using Ajax
 
HTML 5
HTML 5HTML 5
HTML 5
 
Html5(2)
Html5(2)Html5(2)
Html5(2)
 
INFT132 093 07 Document Object Model
INFT132 093 07 Document Object ModelINFT132 093 07 Document Object Model
INFT132 093 07 Document Object Model
 
introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5
 
Dom(document object model)
Dom(document object model)Dom(document object model)
Dom(document object model)
 
3.jsp tutorial
3.jsp tutorial3.jsp tutorial
3.jsp tutorial
 
Document object model
Document object modelDocument object model
Document object model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 
Introduction To Building Enterprise Web Application With Spring Mvc
Introduction To Building Enterprise Web Application With Spring MvcIntroduction To Building Enterprise Web Application With Spring Mvc
Introduction To Building Enterprise Web Application With Spring Mvc
 
Document object model(dom)
Document object model(dom)Document object model(dom)
Document object model(dom)
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
 
Building Web Application Using Spring Framework
Building Web Application Using Spring FrameworkBuilding Web Application Using Spring Framework
Building Web Application Using Spring Framework
 
Open Source Technology
Open Source TechnologyOpen Source Technology
Open Source Technology
 

Similar to ASP.NET - Building Web Application..in the right way!

Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
Thomas Robbins
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handson
Prashant Kumar
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
Fajar Baskoro
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_HourDilip Patel
 
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
Daniel Fisher
 
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ASP.NET MVC_Routing_Authentication_Aurhorization.pdfASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
setit72024
 
ASP.NET MVC 2.0
ASP.NET MVC 2.0ASP.NET MVC 2.0
ASP.NET MVC 2.0
Buu Nguyen
 
Web api
Web apiWeb api
Web api
udaiappa
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
Joe Wilson
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV03) Building an Enterprise Web Solution with AEP(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
BIOVIA
 
Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's important
nonlinear creations
 
Web Development using ASP.NET MVC at HEC
Web Development using ASP.NET MVC at HECWeb Development using ASP.NET MVC at HEC
Web Development using ASP.NET MVC at HECAdil Mughal
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 

Similar to ASP.NET - Building Web Application..in the right way! (20)

Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
 
Day7
Day7Day7
Day7
 
Mvc
MvcMvc
Mvc
 
Asp.net With mvc handson
Asp.net With mvc handsonAsp.net With mvc handson
Asp.net With mvc handson
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
 
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
 
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ASP.NET MVC_Routing_Authentication_Aurhorization.pdfASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
 
ASP.NET MVC 2.0
ASP.NET MVC 2.0ASP.NET MVC 2.0
ASP.NET MVC 2.0
 
Web api
Web apiWeb api
Web api
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
 
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV03) Building an Enterprise Web Solution with AEP(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
 
Sitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's importantSitecore MVC: What it is and why it's important
Sitecore MVC: What it is and why it's important
 
Web Development using ASP.NET MVC at HEC
Web Development using ASP.NET MVC at HECWeb Development using ASP.NET MVC at HEC
Web Development using ASP.NET MVC at HEC
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
MVC 4
MVC 4MVC 4
MVC 4
 

More from Commit Software Sh.p.k.

Building real time app by using asp.Net Core
Building real time app by using asp.Net CoreBuilding real time app by using asp.Net Core
Building real time app by using asp.Net Core
Commit Software Sh.p.k.
 
Let's talk about GraphQL
Let's talk about GraphQLLet's talk about GraphQL
Let's talk about GraphQL
Commit Software Sh.p.k.
 
Arduino and raspberry pi for daily solutions
Arduino and raspberry pi for daily solutionsArduino and raspberry pi for daily solutions
Arduino and raspberry pi for daily solutions
Commit Software Sh.p.k.
 
Lets build a neural network
Lets build a neural networkLets build a neural network
Lets build a neural network
Commit Software Sh.p.k.
 
Hacking a WordPress theme by its child
Hacking a WordPress theme by its childHacking a WordPress theme by its child
Hacking a WordPress theme by its child
Commit Software Sh.p.k.
 
Magento 2 : development and features
Magento 2 : development and featuresMagento 2 : development and features
Magento 2 : development and features
Commit Software Sh.p.k.
 
Building modern applications in the cloud
Building modern applications in the cloudBuilding modern applications in the cloud
Building modern applications in the cloud
Commit Software Sh.p.k.
 
Design patterns: Understand the patterns and design your own
Design patterns: Understand the patterns and design your ownDesign patterns: Understand the patterns and design your own
Design patterns: Understand the patterns and design your own
Commit Software Sh.p.k.
 
Blockchain - a simple implementation
Blockchain - a simple implementationBlockchain - a simple implementation
Blockchain - a simple implementation
Commit Software Sh.p.k.
 
Laravel and angular
Laravel and angularLaravel and angular
Laravel and angular
Commit Software Sh.p.k.
 
Drupal 7: More than a simple CMS
Drupal 7: More than a simple CMSDrupal 7: More than a simple CMS
Drupal 7: More than a simple CMS
Commit Software Sh.p.k.
 
Intro to Hybrid Mobile Development && Ionic
Intro to Hybrid Mobile Development && IonicIntro to Hybrid Mobile Development && Ionic
Intro to Hybrid Mobile Development && Ionic
Commit Software Sh.p.k.
 
Wordpress development 101
Wordpress development 101Wordpress development 101
Wordpress development 101
Commit Software Sh.p.k.
 
Ruby on rails
Ruby on rails   Ruby on rails
Ruby on rails
Commit Software Sh.p.k.
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
Commit Software Sh.p.k.
 
Web apps in Python
Web apps in PythonWeb apps in Python
Web apps in Python
Commit Software Sh.p.k.
 
Laravel - The PHP framework for web artisans
Laravel - The PHP framework for web artisansLaravel - The PHP framework for web artisans
Laravel - The PHP framework for web artisans
Commit Software Sh.p.k.
 
Automation using RaspberryPi and Arduino
Automation using RaspberryPi and ArduinoAutomation using RaspberryPi and Arduino
Automation using RaspberryPi and Arduino
Commit Software Sh.p.k.
 

More from Commit Software Sh.p.k. (18)

Building real time app by using asp.Net Core
Building real time app by using asp.Net CoreBuilding real time app by using asp.Net Core
Building real time app by using asp.Net Core
 
Let's talk about GraphQL
Let's talk about GraphQLLet's talk about GraphQL
Let's talk about GraphQL
 
Arduino and raspberry pi for daily solutions
Arduino and raspberry pi for daily solutionsArduino and raspberry pi for daily solutions
Arduino and raspberry pi for daily solutions
 
Lets build a neural network
Lets build a neural networkLets build a neural network
Lets build a neural network
 
Hacking a WordPress theme by its child
Hacking a WordPress theme by its childHacking a WordPress theme by its child
Hacking a WordPress theme by its child
 
Magento 2 : development and features
Magento 2 : development and featuresMagento 2 : development and features
Magento 2 : development and features
 
Building modern applications in the cloud
Building modern applications in the cloudBuilding modern applications in the cloud
Building modern applications in the cloud
 
Design patterns: Understand the patterns and design your own
Design patterns: Understand the patterns and design your ownDesign patterns: Understand the patterns and design your own
Design patterns: Understand the patterns and design your own
 
Blockchain - a simple implementation
Blockchain - a simple implementationBlockchain - a simple implementation
Blockchain - a simple implementation
 
Laravel and angular
Laravel and angularLaravel and angular
Laravel and angular
 
Drupal 7: More than a simple CMS
Drupal 7: More than a simple CMSDrupal 7: More than a simple CMS
Drupal 7: More than a simple CMS
 
Intro to Hybrid Mobile Development && Ionic
Intro to Hybrid Mobile Development && IonicIntro to Hybrid Mobile Development && Ionic
Intro to Hybrid Mobile Development && Ionic
 
Wordpress development 101
Wordpress development 101Wordpress development 101
Wordpress development 101
 
Ruby on rails
Ruby on rails   Ruby on rails
Ruby on rails
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Web apps in Python
Web apps in PythonWeb apps in Python
Web apps in Python
 
Laravel - The PHP framework for web artisans
Laravel - The PHP framework for web artisansLaravel - The PHP framework for web artisans
Laravel - The PHP framework for web artisans
 
Automation using RaspberryPi and Arduino
Automation using RaspberryPi and ArduinoAutomation using RaspberryPi and Arduino
Automation using RaspberryPi and Arduino
 

Recently uploaded

一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
top1002
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 

Recently uploaded (20)

一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 

ASP.NET - Building Web Application..in the right way!

  • 1. ASP.NET: Building Web Application… in the right way
  • 2. ASP.NET a brief history • 2001 – first release • 2009 – ASP.NET MVC • 2012 – ASP.NET Web API • 2013 – OWIN and SignalR • 2015 – ASP.NET 5 (RC1)
  • 4. MVC web style Webpageinteracts with Controller Model View selects a passes a model to acts on gets data fromproduces invokes
  • 5. ASP.NET MVC • A new presentation option for ASP.NET • Simpler way to program ASP.NET • Easily testable and TDD friendly • More control over your <html/> • More control over your URLs • Supports existing ASP.NET features • Removes: viewstate and postback needs
  • 6. Routing Webpageinteracts with Controller Model View selects a passes a model to acts on gets data fromproduces invokes
  • 7. Routing - example public class OrdersController : Controller { public ActionResult Index() { } public ActionResult Details(int id) { } } http://www.yoursite.com/Orders/Details/1
  • 8. Routing - example http://www.yoursite.com/Orders/Details/1 public class OrdersController : Controller { public ActionResult Index() { } public ActionResult Details(int id) { } }
  • 9. Routing - example http://www.yoursite.com/Orders/Details/1 public class OrdersController : Controller { public ActionResult Index() { } public ActionResult Details(int id) { } }
  • 10. Routing – configuration public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }); }
  • 11. Routing – configuration routes.MapMvcAttributeRoutes(); // public class OrdersController : Controller { [Route("Orders/{id}/Items")] public ActionResult OrderItems(int id) { } } http://www.yoursite.com/Orders/1/Items
  • 12. Controller Webpageinteracts with Controller Model View selects a passes a model to acts on gets data fromproduces invokes
  • 13. Controller public class OrdersController : Controller { public ActionResult Details(int? id) { Order order = db.Orders.Find(id); if (order == null) return HttpNotFound(); return View(order); } } View("MyWonderfulOrderView", order);
  • 14. Controller – routing and HTTP methods public class OrdersController : Controller { // GET: Orders/Edit/5 public ActionResult Edit(int? id) { } // POST: Orders/Edit/5 [HttpPost] public ActionResult Edit(Order order) { } }
  • 15. Model Webpageinteracts with Controller Model View selects a passes a model to acts on gets data fromproduces invokes
  • 16. Model • View Model or Business Model • Validation attributes, for example: • Required • EmailAddress • StringLength • View-related attributes, e.g. Display public class LoginViewModel { [Required] [Display(Name = "Email address")] [EmailAddress] public string Email { get; set; } [Required] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [Display(Name = "Remember me")] public bool RememberMe { get; set; } }
  • 17. View Webpageinteracts with Controller Model View selects a passes a model to acts on gets data fromproduces invokes
  • 18. View • Related to controllers/actions by naming convetion • Several View Engine. Standard: Razor, WebFormViewEngine • Support layouts and partial views • Can use strongly-typed model (e.g. Order) or dynamic one (ViewBag) • @Html helper methods (e.g. @Html.TextBoxFor) • @Html methods can be extended
  • 19. ActionResult • ActionResult is the base class for action’s return types • Available results: • ViewResult - Renders a specifed view to the response stream • RedirectResult - Performs an HTTP redirection to a specifed URL • RedirectToRouteResult - Performs an HTTP redirection to a URL that is determined by the routing engine, based on given route data • JsonResult - Serializes a given ViewData object to JSON format • ContentResult - Writes content to the response stream without requiring a view • FileContentResult - Returns a file to the client • and more
  • 20. Model binder • Transform values from client to .NET class instances or primitive types • Retrieves values from HTML form variables, POSTed variables, query string and routing parameters • DefaultModelBinder is the default binder • Binding can be customized, for specific types at application level or at action’s parameter level
  • 21. Filters • Enable Aspect Oriented Programming (AOP) • Different types for different needs: • Authorization filters – IAuthorizationFilter • Action filters – IActionFilter • Result filters – IResultFilter • Exception filters – IExceptionFilter • Filters can be applied to a single action or a whole controller
  • 23. ASP.NET Web API • Formerly part of WCF framework • 2012 – First release • 2013 – Release of Web API 2 • First class framework for HTTP-based services • Foundamental for creating RESTful services • Self-hosted • Different stacks, same concepts – System.Web.Mvc  System.Web.Http
  • 24. ASP.NET Web API cf. MVC • Similar route patterns declarations • Request/method name matching by HTTP verbs config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional }
  • 25. ASP.NET Web API cf. MVC GET http://www.yoursite.com/api/Orders/5 public class OrdersController : ApiController { IQueryable<Order> GetOrders() { … } IHttpActionResult GetOrder(int id) { … } IHttpActionResult PutOrder(int id, Order order) { … } IHttpActionResult PostOrder(Order order) { … } IHttpActionResult DeleteOrder(int id) { … } }
  • 26. ASP.NET Web API cf. MVC • No views or ActionResult just data or IHttpActionResult • Data are serialized in JSON or other format (e.g. XML) • Controllers inherit from ApiController • No more HttpContext.Current • View filters
  • 27. ASP.NET Web API - OData “An open protocol to allow the creation and consumption of queryable and interoperable RESTful APIs in a simple and standard way” EnableQueryAttribute Implements out of the box most of the OData query system: filters, pagination, projection, etc.
  • 28. Let’s go to code Let’s go to code
  • 31. ASP.NET 5 – .NET Core • Totally modular • Faster development cycle • Seamless transition from on-premises to cloud • Choose your editor and tools • Open-source • Cross-platform • Fast
  • 32. ASP.NET 5 cf. ASP.NET 4.X • No more Web Forms and Web API only MVC • One ring stack to rule them all, i.e. no more double coding • Tag helpers – cleaner HTML views • Project and configuration files in JSON • Server side and client side packages completelly decoupled • much more 
  • 33. thank you for your attention stay tuned for next workshops Andrea Vallotti, ph.D andrea.vallotti@commitsoftware.it

Editor's Notes

  1. 1970s – First «implemetation» 1988 – Described as a pattern several interpretations mainly used in GUI clear division between domain objects that model our perception of the real world, and presentation objects that are the GUI elements we see on the screen one model – multiple views (even command line)
  2. Given an URL, the routing engine is in charge of: invoking the correct controller and method (called action); parsing the parameters contained in it.
  3. By naming convetion routing engine will look for a controller (i.e. a class) named OrdersController; Then it will look for an action (i.e. a method) named Details; Routing engine will also try to parse the URL looking for parameter which should be passed to
  4. By naming convetion routing engine will look for a controller (i.e. a class) named OrdersController; Then it will look for an action (i.e. a method) named Details; Routing engine will also try to parse the URL looking for parameter which should be passed to
  5. By naming convetion routing engine will look for a controller (i.e. a class) named OrdersController; Then it will look for an action (i.e. a method) named Details; Routing engine will also try to parse the URL looking for parameter which should be passed to
  6. Standard way of defining routing convention/pattern; Several definitions can be added; Priority based on order; Segment defaults or optional.
  7. Highly customizable Integrated with the "standard approach";
  8. What is a controller: it is a class which derives from Controller class; it exposes public methods which return ActionResult or subclasses of the latter (see in detail later); these methods are called actions; Inside the action usually: it gets a model and acts on it; then select a View (by default the view has the same name of the action) and pass to it the model Other ways to pass data to the View: ViewBag: dynamic, property of the controller Stateless As a rule of thumb actions name must be different even if signatures differ otherwise routing is not able to choose the correct method for a given URL
  9. You can have more more methods with the same name by specifing the HTTP method: AcceptVerbsAttribute HttpDeleteAttribute HttpGetAttribute HttpHeadAttribute HttpOptionsAttribute HttpPatchAttribute HttpPostAttribute HttpPutAttribute
  10. The Model of MVC is intended to be a "View Model" (example default UserLoginModel) However also the Business Model can be used You can use validation attribute to let MVC validate the user input
  11. The Model of MVC is intended to be a "View Model" (example default LoginViewModel) However also the Business Model can be used You can use validation attribute to let MVC validate the user input You can also use attribute to help rendering the view System.ComponentModel.DataAnnotations
  12. Helper, Bundle, etc.
  13. By default all the views are placed in Views/<controller name>/<action name>.cshtml Each project can use its preferred View Engine There are also third-party View Engine which allow to use RoR or Django syntax Layouts are like master pages in old ASP.NET Different layouts can be used for different sections of the application (using Layout property) Strongly-typed using @model directive, dynamic using ViewBag ViewBag can be used by the View (even in strongly-typed) to pass information to the layout and partial views Html helper methods can be used to render standard html elements Helper, Bundle, etc.
  14. Usually action’s return type is ActionResult but you can be more specific using a derived class
  15. DefaultModelBinder creates an empty instance and fills it with values received from client The default binder can be changed using ModelBinders.Binders.DefaultBinder We will see a customization example during the demo
  16. Filters are executed in the order listed Authorization filters are used to implement authentication and authorization for controller actions You can use an action filter, for instance, to modify the view data that a controller action returns. Result filters - you might want to modify a view result right before the view is rendered to the browser. You can use an exception filter to handle errors raised by either your controller actions or controller action results. You also can use exception filters to log errors. System.Web.Mvc.FilterAttribute base class
  17. WCF – Windows Communication Foundation is mainly aimed to SOAP-based services ASP.NET MVC relies on IIS (standard or express) while ASP.NET Web API can be self-hosted
  18. Routing - same declaration style, different classes By default action are matched by HTTP verbs not segment of URL
  19. GET http://www.yoursite.com/api/Orders/5  OrdersController.GetOrder(5)
  20. Data are serialized in JSON or XML based on Accept header of HTTP request Web API was design to work without a web server (i.e. IIS) and with async framework therefore you should never use HttpContext.Current especially when self-hosted Web API is responsible to pass the correct context to each operation Action, Authorization and Exception filters are still available
  21. Basically OData is a way to standardize REST services, e.g. by defining how to filter It is «simply» an action filter which works with an IQueryable
  22. .NET Core 5: is the version of .NET that runs on Mac, Windows and Linux; brings features via packages  framework much smaller; ASP.NET 5 runs both on .NET Framework 4.6 and .NET Core;
  23. Totally modular – cause all the library (such as MVC, file, etc.) have been stripped from the core  you have to download them with NuGet Faster development cycle – simply modify the code and refresh your page, the code will be automatically compiled Seamless transition – the application runs with its own framework and libraries therefore you do not need to install «special» stuff on the server Editor and tools – Visual Studio, Visual Studio Code on all platforms but through OmniaSharp also emacs, sublime, etc. are supported. Yeoman generator!!! Cross-platform – Kestrel is a standalone web server based on libuv (the same as Node.JS), Fast  benchmarks show that ASP.NET 5 is faster than Node.JS 
  24. ASP.NET 5  only MVC which contains both old MVC and Web API One stack  one Controller base class, one routing configuration, model binding, etc. All controllers can have actions which return ActionResult or data System.Web.* does not exist anymore we have the package Microsoft.AspNet.Mvc Tag helpers  just like angular directive, allows to write more HTML and take advantage of intellisense for CSS and HTML JSON files  no more XML, JSON is easier to understand and widely used Server/client side  NuGet for the server and Bower for the client
  25. Vi rigrazio per l’attenzione e spero di essere riuscito a sintetizzare un argomento che richiede molti approfondimenti. Qui trovate i miei contatti e sono a disposizione al desk per un veloce incontro per rispondere a tutte le vostre domande. Grazie ancora e buon forum a tutti.