SlideShare a Scribd company logo
1 of 58
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
Ido Flatow
Getting to Know ASP.NET 5 and MVC 6
Agenda
Introduction to ASP.NET 5
What’s new in ASP.NET 5
ASP.NET MVC 6
About Me
Senior Architect, Sela Group
Microsoft Regional Director, and an ASP.NET/IIS MVP
Co-author of courses and books
Focus on server, web, and cloud
Manager of the Israeli Web Developers User Group
History of ASP (18 years)
1996 - Active Server Pages (ASP)
2002 – ASP.NET
2008 – ASP.NET MVC
2010 – ASP.NET Web Pages
2012 – ASP.NET Web API, SignalR
2014 – ASP.NET vNext
Current ASP.NET stack
Windows Server
IIS
.NET Framework
ASP.NET
Web
Forms
MVC Web API
System.Web
HTTP
Modules
HTTP
Handlers
Request
Pipeline
Caching
Session
State
Problems with ASP.NET architecture
Limited hosting possibilities (IIS only)
Dependency on IIS environment (System.Web)
Web evolves faster than .NET framework
Requires full-blown .NET framework - resource
intensive and not web-friendly
Hard to optimize for lightweight high-
performance apps
Introducing ASP.NET 5 stack
OS
.NET CLR
ASP.NET
Web API MVC Web Pages
Host
IIS Self-hosted
.NET Core CLR
Middleware
.NET 2015: High-Level Overview
.NET Framework 4.6
.NET Core & App Models
Caution
At the time of this presentation, we are using
DNX-CLR-x86 1.0.0-beta4 (ASP.NET 5 beta 4)
As things are moving really fast in this new
world, it’s very likely that the things explained
here will slightly change
ASP.NET 5 – Agility
Faster Development Cycle
Features are shipped as packages
Framework ships as part of the application
More Control
Zero day security bugs patched by Microsoft
Same code runs in development and production
Developer opts into new versions, allowing breaking
changes
ASP.NET 5 - Fast
Runtime Performance
Faster startup times
Lower memory / higher density (> 90% reduction)
Modular, opt into just features needed
Use a raw socket, framework or both
Development productivity and low friction
Edit code and refresh browser
Flexibility of dynamic environment with the power of
.NET
Develop with Visual Studio, third party and cloud
editors
ASP.NET 5 – Cross Platform
Runtime
Windows, Mac, Linux
Editors
Visual Studio, Text, Cloud editors
OmniSharp – Sublime, Emacs, Vi, etc.
No editors (command line)
All Open Source with Contributions
ASP.NET 5 Features
New flexible and cross-platform runtime
New modular HTTP request pipeline
Robust environment configuration
Unified programming model for MVC API
See changes without re-building the project
Side-by-side versioning of the .NET Framework
Built in Dependency Injection
Ability to self-host or host on IIS
Open source in GitHub
File  New Project  Web
Web App
Class Lib?
Console App?
Select a Template
Startup.cs Configuration
Let's talk about OWIN
Open Web Interface for .NET
Community project (http://owin.org)
Decouples application from server
Enforces modularity of the server
Stack of modules (middlewares) is processing
the request from application to server
Microsoft implementation of OWIN is "Katana"
OWIN Implementation
Host
Middleware
Server
Application
Middleware
Middleware
Request Response
Startup, bootstrapping,
process management
Manages sockets,
delegates to middlewares
Pass-through
components stack
Your code
ASP.NET 5 Middlewares
Improved HTTP performance
New HTTP request pipeline that is lean and fast
The new pipeline also supports OWIN
You choose what to use in your application
By registering middlewares
public void Configure(IApplicationBuilder app,
IHostingEnvironment env, ILoggerFactory loggerfactory)
{
app.UseErrorHandler("/Home/Error");
app.UseStaticFiles();
app.UseIdentity();
app.UseMvc(routes => ...)
}
Custom Middleware
Create middleware class
app.UseMiddleware<AppHeaderMiddleware>();
// Register before app.UseMvc(...);
public class AppHeaderMiddleware {
private readonly RequestDelegate next;
public AppHeaderMiddleware(RequestDelegate next) {
this.next = next;
}
public async Task Invoke(HttpContext context) {
context.Response.Headers.Append(
"X-Application", "ASP.NET 5 Sample App");
await this.next.Invoke(context);
}
}
Register in Startup.cs (IApplicationBuilder)
Project.json
Package Management
ASP.NET 5 introduces a new, lightweight way to
manage dependencies in your projects
No more assembly references
Instead referencing NuGet packages
project.json file
Structure of the "project.json" file
Dependencies - lists all the dependencies of your
application (NuGet, source files, etc.)
Configuration - compilation settings (debug,
release)
Frameworks - target frameworks with their
dependencies
Sources - what should be compiled
Web root - server root of the app
Shared files - files shared with dependent projects
Commands - commands available to “dnx”
Scripts - pre/post events to hook scripts to
Metadata - general project information
Right-click  (Project) Properties
Compilation Process
Debugging without Roslyn
Change the
code
C#
Compiler
invoked
Load code
in memory
Execute
the dll
dll loaded
in memory
from File
system
Emits the
dll in file
system
Debugging with Roslyn
Change the
code
Load code
in memory
Code is
Executed in
memory
Roslyn
compiles
code in
memory
Time reduced from 7-8 second to 1-2 second
"K“ / ”DNX” Command Line Tools
KRE / DNX- Runtime Environment
Engine that runs your application (compilation system,
SDK tools, and the native CLR hosts)
KVM / DNVM - Version Manager
Tool for updating and installing different versions of
KRE/DNX
KPM / DNU- Package Manager
Tool to restore and install (NuGet) packages needed by
applications to run
K / DNX
Entry point to the runtime - starts the runtime with
commands
OpenSource
Runtime Loader
IIS: WebEngine4
Exe: OS
DNX
Operating SystemWindows
Windows, OSX,
Linux
Libraries
Loose, GAC,
Nuget
NuGet, NPM,
Bower
App FrameworksFCL, GAC, NuGet NuGet
Web ServerIIS
IIS, HTTP.SYS,
Kestrel
Application HostSystem.Web DNX
Platform Libraries.NET BCL & FCL
.NET BCL & FCL
.NET on Nuget
Runtime.NET CLR
.NET CLR
.NET Core CLR
Application
MSBuild/CodeDom
-> csc.exe
DNX (Roslyn)
Present vs. Future
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
MVC 6
ASP.NET <5 Frameworks
ASP.NET 5 with MVC 6
MVC + Web API + Web Pages =
ASP.NET MVC 6!
ASP.NET MVC 6
No more duplication - one set of concepts
Used for creating both UI and API
Smooth transition from Web Pages to MVC
Based on the new ASP.NET 5 pipeline
Built DI first
Runs on IIS or self-host
Getting Started with MVC 6
Startup.cs
Project.json
app.UseMvc(routes =>
{
routes.MapRoute("default", "{controller}/{action}/{id?}",
new { controller = "Home", action = "Index" });
});
app.UseServices(services => { services.addMvc(); })
"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-*",
// Add this:
"Microsoft.AspNet.Mvc": "6.0.0-*"
}
Routing Template Improvements
Inline constraints
Product/{ProductId:long}
Product/{ProductName:alpha}
Product/{ProductName:minlength(10)}
Product/{productId:regex(^d{4}$)}
Optional parameters
Product/{productId:long?}
Default values
Product/{productId:long=1}
Available with MapRoute() and [Route()]
https://github.com/aspnet/Routing/tree/dev/src/
Microsoft.AspNet.Routing
Where is the Web API
Configuration?
Route configuration -> attribute-based routing
Message handlers -> middleware pipeline
Filters and Formatters -> startup.cs
app.UseServices(services => {
services.Configure<MvcOptions>(options =>
{
options.AddXmlDataContractSerializerFormatter();
options.Filters.Add(new ValidatorFilterAttribute());
});
}
Controllers – Two Birds, One Stone
API – similar, but different
UI – same as with MVC 5
[Route("api/[controller]")]
public class ProductsController : Controller
{
[HttpGet("{id:int}")]
public Product GetProduct(int id)
{
return new Product() { ID = id };
}
}
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
Actions – API with IActionResult
[HttpGet("{id:int}", Name = "GetByIdRoute")]
public IActionResult GetById (int id)
{
var item = _items.FirstOrDefault(x => x.Id == id);
if (item == null) { return HttpNotFound(); }
return new ObjectResult(item);
}
[HttpPost]
public IActionResult CreateTodoItem([FromBody] TodoItem item)
{
_items.Add(item);
return CreatedAtRoute(
"GetByIdRoute", new { id = item.Id }, item);
}
IActionResult for UI and API
https://github.com/aspnet/Mvc/tree/dev/src/
Microsoft.AspNet.Mvc.Core/ActionResults
UI API
PartialViewResult BadRequestResult
RedirectResult ContentResult
ViewResult CreatedAtRouteResult
JsonResult HttpStatusCodeResult
JsonResult
ObjectResult
ChallengeResult
HttpNotFoundResult
FileContentResult
Content Negotiation
MVC still respects Accept headers
The XML formatter was removed from the MVC 6
pipeline
You can manually add it to the Formatters collection
Forcing a content-type:
Return a JsonResult
Use the [Produces("application/json")] attribute
Additional changes:
Actions returning string result in text/plain responses
Returning null/void – response will be HTTP 204 (no
content)
Last Controller Goodie - DI
Dependency Injection and MVC
ASP.NET 5 is DI-friendly
Basic DI container available throughout the stack
BYOC is also supported (already implemented for
Autofac, Ninject, StructureMap, Unity, and Windsor)
Out-of-the-box container supports
Singleton / Instance – single instance
Transient – new instance each time
Scoped – new instance per request
https://github.com/aspnet/DependencyInjection/tree
/dev/src
Last Controller Goodie - DI
public class ProductsController : Controller
{
private readonly IProductsRepository _repository;
public ProductsController(IProductsRepository repository)
{
this._repository = repository;
}
public IActionResult Index()
{
var products = _repository.GetAllProducts();
return View(products);
}
}
app.UseServices(services =>
{
services.AddTransient<IProductsRepository, DefaultProductsRepository>();
});
Look Ma No Controller
Use the Controller suffix
Inject HTTP request, principal, and view data with:
Convention-based property injection
Constructor injection
public class SimpleController
{
[Activate]
public ActionContext ActionContext { get; set; }
[Activate]
public ViewDataDictionary ViewData { get; set; }
[Activate]
public IUrlHelper Url { get; set; }
public string Get()
{
return "Hello world";
}
}
Enough with Controllers,
What About MVC Views?
Oh, right!
Child Actions in MVC <6
Rendering partial views with controller logic
and model
Do not confuse with Html.Partial
@Html.Action("GetProductDetails", "Products", new { id = 1})
[ChildActionOnly]
public ActionResult GetProductDetails(int id)
{
var product = _repository.GetProduct(id);
return PartialView("ProductDetails", product);
}
Child Actions in MVC 6
So what’s the problem?
Part of a controller, but invoked from a view
Controller flow must distinguish between HTTP calls and
view calls
Pattern lacks an asynchronous invocation
Solution?
Replace child actions with View Components
Same partial views, but declared in a separate class
Think of it as a “mini-controller”
Supports the same DI and POCO features as a controller
Implement actions as synchronous or asynchronous
View Components in MVC 6
//[ViewComponent(Name = "ProductDetails")]
public class ProductDetailsViewComponent : ViewComponent
{
private readonly IProductsRepository _repository;
public ProductDetailsViewComponent(IProductsRepository repository)
{
_repository = repository;
}
public IViewComponentResult Invoke(int id)
{
var product = _repository.GetProduct(id);
return View(product);
}
@Component.Invoke("ProductDetails", 1)
// Or as async, if InvokeAsync is implemented in the view component
@await Component.InvokeAsync("ProductDetails", 1)
And the Partial View?
Create a default.cshtml file
(content structured similar as with MVC <6)
Place file in:
Controller-specific:
Views/{controller}/Components/ProductDetails/Default.cshtml
Shared:
Views/Shared/Components/ProductDetails/Default.cshtml
Customizing view name is supported
Create a file other than Default.cshtml
Return View(viewName, model)
Injecting Services to Views
Preferable than using static classes/methods
Use interfaces instead of concrete types
Register in IoC using different lifecycles
public class CatalogService : ICatalogService
{
public async Task<int> GetTotalProducts() {...} // From ICatalogService
}
@inject MyApp.Services.ICatalogService Catalog
<html>
<body>
<h3>Number of products in the catalog</h3>
@await Catalog.GetTotalProducts()
</body>
</html>
services.AddTransient<ICatalogService, CatalogService>();
Last, but not Least, Tag Helpers
Do this:
Ah? What’s that?
Instead of doing this:
<form asp-anti-forgery="true" asp-action="UpdateProduct">
…
</form>
using (Html.BeginForm("UpdateProduct", "Products", FormMethod.Post))
{
@Html.AntiForgeryToken()
…
}
It’s the return of Web Controls, NOOOOOO!!!
Tag Helpers are not Evil
Tag Helpers generate markup only within their
enclosing tag
Less Razor/HTML mess in the .cshtml file
JavaScript directive style approach
Use C# to better construct the markup
Add/remove parts from the inner content
Generate complex HTML (recursive, nested, …)
Cache the output
Existing Tag Helpers
HTML elements
<a>, <form>, <input>, <label>, <link>, <script>,
<select>, <textarea>
Logical
<cache>
Placeholders
ValidationSummary (<div>), ValidationMessage (<span>)
You can create your own Tag Helpers
Check out the source for reference
https://github.com/aspnet/Mvc/tree/dev/src/Micros
oft.AspNet.Mvc.TagHelpers
Key Improvements in ASP.NET 5
Totally modular
NuGet is first-class citizen in ASP.NET 5
Everything is a package
Lightweight - you use minumum set of modules
Faster startup, lower memory (>90%)
Does not require .NET Framework installation -
runtime environment (CLR) can be deployed
with your application
Key Improvements in ASP.NET 5
Cross platform - can be hosted anywhere:
IIS, self-hosted, Linux, MAC...
Web Forms are left aside for now
Better developer experience
No-compile debugging with Roslyn, MVC unified
programming model, basic DI out-of-the-box...
Everything is open-source
Architecture is OWIN based
Getting Started with ASP.NET 5
Ships with Visual Studio 2015
Walkthroughs and samples at http://asp.net/vnext
Documentation at http://docs.asp.net/en/latest
Get the code from http://github.com/aspnet
Read blogs at http://blogs.msdn.com/b/webdev
Try out a nightly build from MyGet
https://www.myget.org/F/aspnetvnext
My Info
idof@sela.co.il
@idoFlatow
http://bit.ly/flatowblog

More Related Content

What's hot

An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST Ram Awadh Prasad, PMP
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlowAiste Stikliute
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web APIBrad Genereaux
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20Phil Wilkins
 
Running distributed tests with k6.pdf
Running distributed tests with k6.pdfRunning distributed tests with k6.pdf
Running distributed tests with k6.pdfLibbySchulze
 
The New JavaScript: ES6
The New JavaScript: ES6The New JavaScript: ES6
The New JavaScript: ES6Rob Eisenberg
 
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of SignalsCoding Academy
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewShahed Chowdhuri
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & DevelopmentAshok Pundit
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET CoreAvanade Nederland
 
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Edureka!
 
Spring security oauth2
Spring security oauth2Spring security oauth2
Spring security oauth2axykim00
 
API_Testing_with_Postman
API_Testing_with_PostmanAPI_Testing_with_Postman
API_Testing_with_PostmanMithilesh Singh
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start GuideAndrii Gakhov
 

What's hot (20)

An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
Express js
Express jsExpress js
Express js
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
 
Why HATEOAS
Why HATEOASWhy HATEOAS
Why HATEOAS
 
Running distributed tests with k6.pdf
Running distributed tests with k6.pdfRunning distributed tests with k6.pdf
Running distributed tests with k6.pdf
 
The New JavaScript: ES6
The New JavaScript: ES6The New JavaScript: ES6
The New JavaScript: ES6
 
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of Signals
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 
REST API Design & Development
REST API Design & DevelopmentREST API Design & Development
REST API Design & Development
 
Introduction to ASP.NET Core
Introduction to ASP.NET CoreIntroduction to ASP.NET Core
Introduction to ASP.NET Core
 
Api testing
Api testingApi testing
Api testing
 
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring security oauth2
Spring security oauth2Spring security oauth2
Spring security oauth2
 
Express JS
Express JSExpress JS
Express JS
 
API_Testing_with_Postman
API_Testing_with_PostmanAPI_Testing_with_Postman
API_Testing_with_Postman
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start Guide
 

Viewers also liked

Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics PresentationSudhakar Sharma
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsIdo Flatow
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overviewSergey Seletsky
 
Getting Started with ASP.NET MVC
Getting Started with ASP.NET MVCGetting Started with ASP.NET MVC
Getting Started with ASP.NET MVCshobokshi
 
ASP.NET MVC Best Practices malisa ncube
ASP.NET MVC Best Practices   malisa ncubeASP.NET MVC Best Practices   malisa ncube
ASP.NET MVC Best Practices malisa ncubeMalisa Ncube
 
Async patterns in javascript
Async patterns in javascriptAsync patterns in javascript
Async patterns in javascriptRan Wahle
 
Responsive ui
Responsive uiResponsive ui
Responsive uiRan Wahle
 
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 2013Thomas Robbins
 
What's New in WCF 4.5
What's New in WCF 4.5What's New in WCF 4.5
What's New in WCF 4.5Ido Flatow
 
The Essentials of Building Cloud-Based Web Apps with Azure
The Essentials of Building Cloud-Based Web Apps with AzureThe Essentials of Building Cloud-Based Web Apps with Azure
The Essentials of Building Cloud-Based Web Apps with AzureIdo Flatow
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For DevelopersIdo Flatow
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with FiddlerIdo Flatow
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGil Fink
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0Ido Flatow
 

Viewers also liked (20)

MVC 6 Introduction
MVC 6 IntroductionMVC 6 Introduction
MVC 6 Introduction
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics Presentation
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Asp.net mvc 5 course module 1 overview
Asp.net mvc 5 course   module 1 overviewAsp.net mvc 5 course   module 1 overview
Asp.net mvc 5 course module 1 overview
 
Getting Started with ASP.NET MVC
Getting Started with ASP.NET MVCGetting Started with ASP.NET MVC
Getting Started with ASP.NET MVC
 
ASP.NET MVC Best Practices malisa ncube
ASP.NET MVC Best Practices   malisa ncubeASP.NET MVC Best Practices   malisa ncube
ASP.NET MVC Best Practices malisa ncube
 
Webcomponents v2
Webcomponents v2Webcomponents v2
Webcomponents v2
 
Async patterns in javascript
Async patterns in javascriptAsync patterns in javascript
Async patterns in javascript
 
Responsive ui
Responsive uiResponsive ui
Responsive ui
 
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
 
What's New in WCF 4.5
What's New in WCF 4.5What's New in WCF 4.5
What's New in WCF 4.5
 
EF Core (RC2)
EF Core (RC2)EF Core (RC2)
EF Core (RC2)
 
The Essentials of Building Cloud-Based Web Apps with Azure
The Essentials of Building Cloud-Based Web Apps with AzureThe Essentials of Building Cloud-Based Web Apps with Azure
The Essentials of Building Cloud-Based Web Apps with Azure
 
Powershell For Developers
Powershell For DevelopersPowershell For Developers
Powershell For Developers
 
Debugging the Web with Fiddler
Debugging the Web with FiddlerDebugging the Web with Fiddler
Debugging the Web with Fiddler
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript Language
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 

Similar to Learning ASP.NET 5 and MVC 6

The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)Geekstone
 
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)Arrow Consulting & Design
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructuregeorge.james
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressGeorge Kanellopoulos
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Osconvijayrvr
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technologyMinal Maniar
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The BasicsPhilip Langer
 
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Quek Lilian
 
A Microsoft primer for PHP devs
A Microsoft primer for PHP devsA Microsoft primer for PHP devs
A Microsoft primer for PHP devsguest0a62e8
 
Asp dot net final (1)
Asp dot net   final (1)Asp dot net   final (1)
Asp dot net final (1)amelinaahmeti
 
Asp dot net final (1)
Asp dot net   final (1)Asp dot net   final (1)
Asp dot net final (1)amelinaahmeti
 
Windows Loves Drupal
Windows Loves DrupalWindows Loves Drupal
Windows Loves DrupalAcquia
 
RichardChauvetShortResume2015
RichardChauvetShortResume2015RichardChauvetShortResume2015
RichardChauvetShortResume2015Richard Chauvet
 

Similar to Learning ASP.NET 5 and MVC 6 (20)

The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
 
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
 
Asp.net
Asp.netAsp.net
Asp.net
 
Scalable Web Architectures and Infrastructure
Scalable Web Architectures and InfrastructureScalable Web Architectures and Infrastructure
Scalable Web Architectures and Infrastructure
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy Wordress
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Oscon
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
 
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
Creating Dynamic Web Application Using ASP.Net 3 5_MVP Alezandra Buencamino N...
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
 
A Microsoft primer for PHP devs
A Microsoft primer for PHP devsA Microsoft primer for PHP devs
A Microsoft primer for PHP devs
 
Asp dot net final (1)
Asp dot net   final (1)Asp dot net   final (1)
Asp dot net final (1)
 
Asp dot net final (1)
Asp dot net   final (1)Asp dot net   final (1)
Asp dot net final (1)
 
Asp dot net final (1)
Asp dot net   final (1)Asp dot net   final (1)
Asp dot net final (1)
 
Asp dot net long
Asp dot net longAsp dot net long
Asp dot net long
 
Windows Loves Drupal
Windows Loves DrupalWindows Loves Drupal
Windows Loves Drupal
 
RichardChauvetShortResume2015
RichardChauvetShortResume2015RichardChauvetShortResume2015
RichardChauvetShortResume2015
 

More from Ido Flatow

Google Cloud IoT Core
Google Cloud IoT CoreGoogle Cloud IoT Core
Google Cloud IoT CoreIdo Flatow
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
Production Debugging War Stories
Production Debugging War StoriesProduction Debugging War Stories
Production Debugging War StoriesIdo Flatow
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
Production debugging web applications
Production debugging web applicationsProduction debugging web applications
Production debugging web applicationsIdo Flatow
 
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...Ido Flatow
 
Building IoT and Big Data Solutions on Azure
Building IoT and Big Data Solutions on AzureBuilding IoT and Big Data Solutions on Azure
Building IoT and Big Data Solutions on AzureIdo Flatow
 
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the FieldMigrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the FieldIdo Flatow
 
Debugging your Way through .NET with Visual Studio 2015
Debugging your Way through .NET with Visual Studio 2015Debugging your Way through .NET with Visual Studio 2015
Debugging your Way through .NET with Visual Studio 2015Ido Flatow
 
Introducing HTTP/2
Introducing HTTP/2Introducing HTTP/2
Introducing HTTP/2Ido Flatow
 
IaaS vs. PaaS: Windows Azure Compute Solutions
IaaS vs. PaaS: Windows Azure Compute SolutionsIaaS vs. PaaS: Windows Azure Compute Solutions
IaaS vs. PaaS: Windows Azure Compute SolutionsIdo Flatow
 
Advanced WCF Workshop
Advanced WCF WorkshopAdvanced WCF Workshop
Advanced WCF WorkshopIdo Flatow
 
IIS for Developers
IIS for DevelopersIIS for Developers
IIS for DevelopersIdo Flatow
 
Debugging with Fiddler
Debugging with FiddlerDebugging with Fiddler
Debugging with FiddlerIdo Flatow
 
Caching in Windows Azure
Caching in Windows AzureCaching in Windows Azure
Caching in Windows AzureIdo Flatow
 
Automating Windows Azure
Automating Windows AzureAutomating Windows Azure
Automating Windows AzureIdo Flatow
 

More from Ido Flatow (16)

Google Cloud IoT Core
Google Cloud IoT CoreGoogle Cloud IoT Core
Google Cloud IoT Core
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Production Debugging War Stories
Production Debugging War StoriesProduction Debugging War Stories
Production Debugging War Stories
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Production debugging web applications
Production debugging web applicationsProduction debugging web applications
Production debugging web applications
 
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
 
Building IoT and Big Data Solutions on Azure
Building IoT and Big Data Solutions on AzureBuilding IoT and Big Data Solutions on Azure
Building IoT and Big Data Solutions on Azure
 
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the FieldMigrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
 
Debugging your Way through .NET with Visual Studio 2015
Debugging your Way through .NET with Visual Studio 2015Debugging your Way through .NET with Visual Studio 2015
Debugging your Way through .NET with Visual Studio 2015
 
Introducing HTTP/2
Introducing HTTP/2Introducing HTTP/2
Introducing HTTP/2
 
IaaS vs. PaaS: Windows Azure Compute Solutions
IaaS vs. PaaS: Windows Azure Compute SolutionsIaaS vs. PaaS: Windows Azure Compute Solutions
IaaS vs. PaaS: Windows Azure Compute Solutions
 
Advanced WCF Workshop
Advanced WCF WorkshopAdvanced WCF Workshop
Advanced WCF Workshop
 
IIS for Developers
IIS for DevelopersIIS for Developers
IIS for Developers
 
Debugging with Fiddler
Debugging with FiddlerDebugging with Fiddler
Debugging with Fiddler
 
Caching in Windows Azure
Caching in Windows AzureCaching in Windows Azure
Caching in Windows Azure
 
Automating Windows Azure
Automating Windows AzureAutomating Windows Azure
Automating Windows Azure
 

Recently uploaded

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 

Recently uploaded (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 

Learning ASP.NET 5 and MVC 6

  • 1. © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com Ido Flatow Getting to Know ASP.NET 5 and MVC 6
  • 2. Agenda Introduction to ASP.NET 5 What’s new in ASP.NET 5 ASP.NET MVC 6
  • 3. About Me Senior Architect, Sela Group Microsoft Regional Director, and an ASP.NET/IIS MVP Co-author of courses and books Focus on server, web, and cloud Manager of the Israeli Web Developers User Group
  • 4. History of ASP (18 years) 1996 - Active Server Pages (ASP) 2002 – ASP.NET 2008 – ASP.NET MVC 2010 – ASP.NET Web Pages 2012 – ASP.NET Web API, SignalR 2014 – ASP.NET vNext
  • 5. Current ASP.NET stack Windows Server IIS .NET Framework ASP.NET Web Forms MVC Web API System.Web HTTP Modules HTTP Handlers Request Pipeline Caching Session State
  • 6. Problems with ASP.NET architecture Limited hosting possibilities (IIS only) Dependency on IIS environment (System.Web) Web evolves faster than .NET framework Requires full-blown .NET framework - resource intensive and not web-friendly Hard to optimize for lightweight high- performance apps
  • 7. Introducing ASP.NET 5 stack OS .NET CLR ASP.NET Web API MVC Web Pages Host IIS Self-hosted .NET Core CLR Middleware
  • 10. .NET Core & App Models
  • 11. Caution At the time of this presentation, we are using DNX-CLR-x86 1.0.0-beta4 (ASP.NET 5 beta 4) As things are moving really fast in this new world, it’s very likely that the things explained here will slightly change
  • 12. ASP.NET 5 – Agility Faster Development Cycle Features are shipped as packages Framework ships as part of the application More Control Zero day security bugs patched by Microsoft Same code runs in development and production Developer opts into new versions, allowing breaking changes
  • 13. ASP.NET 5 - Fast Runtime Performance Faster startup times Lower memory / higher density (> 90% reduction) Modular, opt into just features needed Use a raw socket, framework or both Development productivity and low friction Edit code and refresh browser Flexibility of dynamic environment with the power of .NET Develop with Visual Studio, third party and cloud editors
  • 14. ASP.NET 5 – Cross Platform Runtime Windows, Mac, Linux Editors Visual Studio, Text, Cloud editors OmniSharp – Sublime, Emacs, Vi, etc. No editors (command line) All Open Source with Contributions
  • 15. ASP.NET 5 Features New flexible and cross-platform runtime New modular HTTP request pipeline Robust environment configuration Unified programming model for MVC API See changes without re-building the project Side-by-side versioning of the .NET Framework Built in Dependency Injection Ability to self-host or host on IIS Open source in GitHub
  • 16. File  New Project  Web Web App Class Lib? Console App?
  • 19. Let's talk about OWIN Open Web Interface for .NET Community project (http://owin.org) Decouples application from server Enforces modularity of the server Stack of modules (middlewares) is processing the request from application to server Microsoft implementation of OWIN is "Katana"
  • 20. OWIN Implementation Host Middleware Server Application Middleware Middleware Request Response Startup, bootstrapping, process management Manages sockets, delegates to middlewares Pass-through components stack Your code
  • 21. ASP.NET 5 Middlewares Improved HTTP performance New HTTP request pipeline that is lean and fast The new pipeline also supports OWIN You choose what to use in your application By registering middlewares public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerfactory) { app.UseErrorHandler("/Home/Error"); app.UseStaticFiles(); app.UseIdentity(); app.UseMvc(routes => ...) }
  • 22. Custom Middleware Create middleware class app.UseMiddleware<AppHeaderMiddleware>(); // Register before app.UseMvc(...); public class AppHeaderMiddleware { private readonly RequestDelegate next; public AppHeaderMiddleware(RequestDelegate next) { this.next = next; } public async Task Invoke(HttpContext context) { context.Response.Headers.Append( "X-Application", "ASP.NET 5 Sample App"); await this.next.Invoke(context); } } Register in Startup.cs (IApplicationBuilder)
  • 24. Package Management ASP.NET 5 introduces a new, lightweight way to manage dependencies in your projects No more assembly references Instead referencing NuGet packages project.json file
  • 25. Structure of the "project.json" file Dependencies - lists all the dependencies of your application (NuGet, source files, etc.) Configuration - compilation settings (debug, release) Frameworks - target frameworks with their dependencies Sources - what should be compiled Web root - server root of the app Shared files - files shared with dependent projects Commands - commands available to “dnx” Scripts - pre/post events to hook scripts to Metadata - general project information
  • 28. Debugging without Roslyn Change the code C# Compiler invoked Load code in memory Execute the dll dll loaded in memory from File system Emits the dll in file system
  • 29. Debugging with Roslyn Change the code Load code in memory Code is Executed in memory Roslyn compiles code in memory Time reduced from 7-8 second to 1-2 second
  • 30. "K“ / ”DNX” Command Line Tools KRE / DNX- Runtime Environment Engine that runs your application (compilation system, SDK tools, and the native CLR hosts) KVM / DNVM - Version Manager Tool for updating and installing different versions of KRE/DNX KPM / DNU- Package Manager Tool to restore and install (NuGet) packages needed by applications to run K / DNX Entry point to the runtime - starts the runtime with commands
  • 31. OpenSource Runtime Loader IIS: WebEngine4 Exe: OS DNX Operating SystemWindows Windows, OSX, Linux Libraries Loose, GAC, Nuget NuGet, NPM, Bower App FrameworksFCL, GAC, NuGet NuGet Web ServerIIS IIS, HTTP.SYS, Kestrel Application HostSystem.Web DNX Platform Libraries.NET BCL & FCL .NET BCL & FCL .NET on Nuget Runtime.NET CLR .NET CLR .NET Core CLR Application MSBuild/CodeDom -> csc.exe DNX (Roslyn) Present vs. Future
  • 32. © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com MVC 6
  • 34. ASP.NET 5 with MVC 6
  • 35. MVC + Web API + Web Pages = ASP.NET MVC 6!
  • 36. ASP.NET MVC 6 No more duplication - one set of concepts Used for creating both UI and API Smooth transition from Web Pages to MVC Based on the new ASP.NET 5 pipeline Built DI first Runs on IIS or self-host
  • 37. Getting Started with MVC 6 Startup.cs Project.json app.UseMvc(routes => { routes.MapRoute("default", "{controller}/{action}/{id?}", new { controller = "Home", action = "Index" }); }); app.UseServices(services => { services.addMvc(); }) "dependencies": { "Microsoft.AspNet.Server.IIS": "1.0.0-*", // Add this: "Microsoft.AspNet.Mvc": "6.0.0-*" }
  • 38. Routing Template Improvements Inline constraints Product/{ProductId:long} Product/{ProductName:alpha} Product/{ProductName:minlength(10)} Product/{productId:regex(^d{4}$)} Optional parameters Product/{productId:long?} Default values Product/{productId:long=1} Available with MapRoute() and [Route()] https://github.com/aspnet/Routing/tree/dev/src/ Microsoft.AspNet.Routing
  • 39. Where is the Web API Configuration? Route configuration -> attribute-based routing Message handlers -> middleware pipeline Filters and Formatters -> startup.cs app.UseServices(services => { services.Configure<MvcOptions>(options => { options.AddXmlDataContractSerializerFormatter(); options.Filters.Add(new ValidatorFilterAttribute()); }); }
  • 40. Controllers – Two Birds, One Stone API – similar, but different UI – same as with MVC 5 [Route("api/[controller]")] public class ProductsController : Controller { [HttpGet("{id:int}")] public Product GetProduct(int id) { return new Product() { ID = id }; } } public class HomeController : Controller { public IActionResult Index() { return View(); } }
  • 41. Actions – API with IActionResult [HttpGet("{id:int}", Name = "GetByIdRoute")] public IActionResult GetById (int id) { var item = _items.FirstOrDefault(x => x.Id == id); if (item == null) { return HttpNotFound(); } return new ObjectResult(item); } [HttpPost] public IActionResult CreateTodoItem([FromBody] TodoItem item) { _items.Add(item); return CreatedAtRoute( "GetByIdRoute", new { id = item.Id }, item); }
  • 42. IActionResult for UI and API https://github.com/aspnet/Mvc/tree/dev/src/ Microsoft.AspNet.Mvc.Core/ActionResults UI API PartialViewResult BadRequestResult RedirectResult ContentResult ViewResult CreatedAtRouteResult JsonResult HttpStatusCodeResult JsonResult ObjectResult ChallengeResult HttpNotFoundResult FileContentResult
  • 43. Content Negotiation MVC still respects Accept headers The XML formatter was removed from the MVC 6 pipeline You can manually add it to the Formatters collection Forcing a content-type: Return a JsonResult Use the [Produces("application/json")] attribute Additional changes: Actions returning string result in text/plain responses Returning null/void – response will be HTTP 204 (no content)
  • 44. Last Controller Goodie - DI Dependency Injection and MVC ASP.NET 5 is DI-friendly Basic DI container available throughout the stack BYOC is also supported (already implemented for Autofac, Ninject, StructureMap, Unity, and Windsor) Out-of-the-box container supports Singleton / Instance – single instance Transient – new instance each time Scoped – new instance per request https://github.com/aspnet/DependencyInjection/tree /dev/src
  • 45. Last Controller Goodie - DI public class ProductsController : Controller { private readonly IProductsRepository _repository; public ProductsController(IProductsRepository repository) { this._repository = repository; } public IActionResult Index() { var products = _repository.GetAllProducts(); return View(products); } } app.UseServices(services => { services.AddTransient<IProductsRepository, DefaultProductsRepository>(); });
  • 46. Look Ma No Controller Use the Controller suffix Inject HTTP request, principal, and view data with: Convention-based property injection Constructor injection public class SimpleController { [Activate] public ActionContext ActionContext { get; set; } [Activate] public ViewDataDictionary ViewData { get; set; } [Activate] public IUrlHelper Url { get; set; } public string Get() { return "Hello world"; } }
  • 47. Enough with Controllers, What About MVC Views? Oh, right!
  • 48. Child Actions in MVC <6 Rendering partial views with controller logic and model Do not confuse with Html.Partial @Html.Action("GetProductDetails", "Products", new { id = 1}) [ChildActionOnly] public ActionResult GetProductDetails(int id) { var product = _repository.GetProduct(id); return PartialView("ProductDetails", product); }
  • 49. Child Actions in MVC 6 So what’s the problem? Part of a controller, but invoked from a view Controller flow must distinguish between HTTP calls and view calls Pattern lacks an asynchronous invocation Solution? Replace child actions with View Components Same partial views, but declared in a separate class Think of it as a “mini-controller” Supports the same DI and POCO features as a controller Implement actions as synchronous or asynchronous
  • 50. View Components in MVC 6 //[ViewComponent(Name = "ProductDetails")] public class ProductDetailsViewComponent : ViewComponent { private readonly IProductsRepository _repository; public ProductDetailsViewComponent(IProductsRepository repository) { _repository = repository; } public IViewComponentResult Invoke(int id) { var product = _repository.GetProduct(id); return View(product); } @Component.Invoke("ProductDetails", 1) // Or as async, if InvokeAsync is implemented in the view component @await Component.InvokeAsync("ProductDetails", 1)
  • 51. And the Partial View? Create a default.cshtml file (content structured similar as with MVC <6) Place file in: Controller-specific: Views/{controller}/Components/ProductDetails/Default.cshtml Shared: Views/Shared/Components/ProductDetails/Default.cshtml Customizing view name is supported Create a file other than Default.cshtml Return View(viewName, model)
  • 52. Injecting Services to Views Preferable than using static classes/methods Use interfaces instead of concrete types Register in IoC using different lifecycles public class CatalogService : ICatalogService { public async Task<int> GetTotalProducts() {...} // From ICatalogService } @inject MyApp.Services.ICatalogService Catalog <html> <body> <h3>Number of products in the catalog</h3> @await Catalog.GetTotalProducts() </body> </html> services.AddTransient<ICatalogService, CatalogService>();
  • 53. Last, but not Least, Tag Helpers Do this: Ah? What’s that? Instead of doing this: <form asp-anti-forgery="true" asp-action="UpdateProduct"> … </form> using (Html.BeginForm("UpdateProduct", "Products", FormMethod.Post)) { @Html.AntiForgeryToken() … } It’s the return of Web Controls, NOOOOOO!!!
  • 54. Tag Helpers are not Evil Tag Helpers generate markup only within their enclosing tag Less Razor/HTML mess in the .cshtml file JavaScript directive style approach Use C# to better construct the markup Add/remove parts from the inner content Generate complex HTML (recursive, nested, …) Cache the output
  • 55. Existing Tag Helpers HTML elements <a>, <form>, <input>, <label>, <link>, <script>, <select>, <textarea> Logical <cache> Placeholders ValidationSummary (<div>), ValidationMessage (<span>) You can create your own Tag Helpers Check out the source for reference https://github.com/aspnet/Mvc/tree/dev/src/Micros oft.AspNet.Mvc.TagHelpers
  • 56. Key Improvements in ASP.NET 5 Totally modular NuGet is first-class citizen in ASP.NET 5 Everything is a package Lightweight - you use minumum set of modules Faster startup, lower memory (>90%) Does not require .NET Framework installation - runtime environment (CLR) can be deployed with your application
  • 57. Key Improvements in ASP.NET 5 Cross platform - can be hosted anywhere: IIS, self-hosted, Linux, MAC... Web Forms are left aside for now Better developer experience No-compile debugging with Roslyn, MVC unified programming model, basic DI out-of-the-box... Everything is open-source Architecture is OWIN based
  • 58. Getting Started with ASP.NET 5 Ships with Visual Studio 2015 Walkthroughs and samples at http://asp.net/vnext Documentation at http://docs.asp.net/en/latest Get the code from http://github.com/aspnet Read blogs at http://blogs.msdn.com/b/webdev Try out a nightly build from MyGet https://www.myget.org/F/aspnetvnext My Info idof@sela.co.il @idoFlatow http://bit.ly/flatowblog

Editor's Notes

  1. Other dependencies that people may find relevant: aspnet.diagnostics, server.weblistener
  2. Don’t use void with beta3, it ignores status codes set in the method