SlideShare a Scribd company logo
DevRock #01 Hello New Year 2015
ASP.NET 5
Chaowlert Chaisrichalermpol
Developer @ Jetabroad
DevRock #01 Hello New Year 2015
JETABOARD
PRODUCTION
DevRock #01 Hello New Year 2015
LEARN
DevRock #01 Hello New Year 2015
ASP.NET 5 NEW PLATFORM
 Unified MVC and WebAPI
 New runtime, no more System.Web, or IIS, or Windows!
 New project structure
 New HTTP pipeline
 New package management
 Common IoC, and log interface + built-in IoC
 New configuration & Options
 New view features
 New front-end workflow
DevRock #01 Hello New Year 2015
OVERVIEW
DevRock #01 Hello New Year 2015
LIBRARIES
.Net full .Net Core
WebForm 4.6 -
MVC 5
MVC 6 (unified with WebAPI)
WebAPI 2
EF 6 EF 7 + support for non-relational
SignalR 2 SignalR 3
DevRock #01 Hello New Year 2015
ASP.NET 5 MODULAR
MVC
Caching
Config
Data
Protect
DI
FileLogging
Options
Razor
Routing
See more at https://github.com/aspnet/Home/wiki/Repo-List
DevRock #01 Hello New Year 2015
ARCHITECTURE
 New project type
 Support new Core CLR
 Self hosted
DevRock #01 Hello New Year 2015
CORE CLR
DevRock #01 Hello New Year 2015
CLR CORE CLR
CLR Core CLR
Install per machine Install per application
1 major version for all applications Run different version side by side
Runtime 200 MB Runtime 11 MB (Only what you need)
Host on Windows Host anywhere
Normal performance Fast startup
Lower memory usage (-35%)*
More request per seconds
Full backward compatibility Some backward compatibility
* http://james.newtonking.com/archive/2014/10/24/json-net-6-0-release-6-asp-net-coreclr-support-
memory-usage-optimizations
DevRock #01 Hello New Year 2015
PROJECT
STRUCTURE
DevRock #01 Hello New Year 2015
PROJECT STUCTURE
 No more global.asax & web.config
 global.json
 Startup.cs
 wwwroot
 project.json
 Files in project always include by
default
DevRock #01 Hello New Year 2015
HTTP PIPELINE
DevRock #01 Hello New Year 2015
HTTP PIPELINE
 Lean & fast
 app.Run()
 app.Use…
public void Configure(IApplicationBuilder app,
IHostingEnvironment env, ILoggerFactory loggerfactory)
{
app.UseErrorHandler("/Home/Error");
app.UseStaticFiles();
app.UseIdentity();
app.UseMvc(routes => ...)
}
DevRock #01 Hello New Year 2015
CUSTOM
public class SampleMiddleware {
private readonly RequestDelegate next;
public SampleMiddleware(RequestDelegate next) {
this.next = next;
}
public async Task Invoke(HttpContext context) {
await this.next.Invoke(context);
}
}
app.UseMiddleware<SampleMiddleware>();
DevRock #01 Hello New Year 2015
MVC
public void ConfigureServices(IServiceCollection
services)
{
service.AddMvc();
}
public void Configure(IApplicationBuilder app,
IHostingEnvironment env, ILoggerFactory loggerfactory)
{
app.UseMvc(routes => ...)
}
DevRock #01 Hello New Year 2015
PACKAGE
MANAGEMENT
DevRock #01 Hello New Year 2015
PACKAGE MANAGEMENT
 Manage packages in project.json
 No more Assembly references
 Reference by NuGet
 kpm
 Packages are cached
DevRock #01 Hello New Year 2015
LOG & IOC
DevRock #01 Hello New Year 2015
LOG IOC
 ILogger
 Console
 NLog
 Serilog
 Custom
 IServiceProvider
 Built-in
 Autofac
 Ninject
 StructureMap
 Unity
 Windsor
 Custom
public void Configure(IApplicationBuilder app,
IHostingEnvironment env, ILoggerFactory loggerfactory)
{
loggerfactory.AddNLog(new NLog.LogFactory());
}
public IServiceProvider
ConfigureServices(IServiceCollection services)
{
...
var builder = new ContainerBuilder();
builder.Populate(services);
return builder.Build().Resolve<IServiceProvider>();
}
DevRock #01 Hello New Year 2015
IOC
 services.AddSingleton
 services.AddScoped
 services.AddTransient
 services.AddInstance
public void ConfigureServices(IServiceCollection services)
{
services.AddScoped<ICalculator, Calculator>();
}
DevRock #01 Hello New Year 2015
CONFIGURATION
& OPTIONS
DevRock #01 Hello New Year 2015
CONFIGURATION
 no more web.config
 Config from multiple sources
 Structure is hierarchy
 Configuration source
 config.AddJsonFile
 config.AddXmlFile
 config.AddIniFile
 config.AddEnvironmentVariable
 config.AddCommandLine
 Get config value
 config.Get
IConfiguration config = new Configuration()
.AddJsonFile("config.json")
.AddEnvironmentVariable();
config.Get("path1:path2");
DevRock #01 Hello New Year 2015
OPTIONS
 Read from config is old school
 Inject config as POCO
 service.Configure<T>
 IOptions<T>
public void ConfigureServices(IServiceCollection services)
{
services.AddOptions();
services.Configure<MyAppOptions>(Config.GetSubKey("MyApp"));
}
DevRock #01 Hello New Year 2015
NEW
VIEW FEATURES
DevRock #01 Hello New Year 2015
VIEWCOMPONENT
 Next step of PartialView
 Behave like Controller
 Razor views are located in
 /Views/{controller}/Components/{component}/{view_name}.cshtml
 /Views/Shared/Components/{component}/{view_name}.cshtml
public class MyViewComponent : ViewComponent {
public IViewComponentResult Invoke(param...) {
return View();
}
}
DevRock #01 Hello New Year 2015
VIEW INJECTION
@{
ViewBag.Title = "Home Page";
}
<div>Value is @calc.Add(1, 1)</div>
@inject ICalculator calc
DevRock #01 Hello New Year 2015
TAGHELPERS
 @HTML.Label("FirstName", "First Name:", new { @class = "caption" })
is unreadable
 <label class="caption" for="FirstName">First Name:</label>
is better
public class DateTimePickerTagHelper : TagHelper {
public override void Process(TagHelperContext context, TagHelperOutput output) {
}
}
@addtaghelper "Assembly.Name"
<datetimepicker id="myDate" value="@Model.StartDate"></datetimepicker>
DevRock #01 Hello New Year 2015
FRON-END FRAMEWORK
DevRock #01 Hello New Year 2015
BOWER
 No more js library from NuGet
 20,000+ packages
 No more js collision
 You decide what should include in
project
DevRock #01 Hello New Year 2015
GRUNT & GULP
 No more ASP.net bundle
 4,000+ tasks
 Bind with Visual Studio
 Before Build
 After Build
 Clean
 Open
DevRock #01 Hello New Year 2015
Q A

More Related Content

PDF
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
PDF
Service oriented web development with OSGi
PDF
A Series of Fortunate Events: Building an Operator in Java
PDF
jdays 2015
PDF
vJUG - The JavaFX Ecosystem
PPTX
Angular 2 in-1
PDF
Serverless Angular, Material, Firebase and Google Cloud applications
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
Service oriented web development with OSGi
A Series of Fortunate Events: Building an Operator in Java
jdays 2015
vJUG - The JavaFX Ecosystem
Angular 2 in-1
Serverless Angular, Material, Firebase and Google Cloud applications

What's hot (20)

PPTX
Vue.js Use Cases
PPTX
Azure Durable Functions
PDF
How to create an Angular builder
PDF
Go swagger tutorial how to create golang api documentation using go swagger (1)
PDF
Introduction to Spring WebFlux #jsug #sf_a1
PDF
Using React with Grails 3
PDF
Spring boot入門ハンズオン第二回
PDF
Angular version 10 is here check out the new features, notable changes, depr...
PPTX
Spring Boot
PPTX
High Performance NodeJS
PPTX
Grails plugin
PPT
Web Deployment With Visual Studio 2010
PDF
React: JSX and Top Level API
PDF
Making the Most of Your Gradle Build
PDF
Sling IDE Tooling
PDF
Contract-driven development with OpenAPI 3 and Vert.x | DevNation Tech Talk
PDF
So how do I test my Sling application?
PDF
JavaDo#09 Spring boot入門ハンズオン
PDF
Sling IDE Tooling @ adaptTo 2013
PPTX
The Past Year in Spring for Apache Geode
Vue.js Use Cases
Azure Durable Functions
How to create an Angular builder
Go swagger tutorial how to create golang api documentation using go swagger (1)
Introduction to Spring WebFlux #jsug #sf_a1
Using React with Grails 3
Spring boot入門ハンズオン第二回
Angular version 10 is here check out the new features, notable changes, depr...
Spring Boot
High Performance NodeJS
Grails plugin
Web Deployment With Visual Studio 2010
React: JSX and Top Level API
Making the Most of Your Gradle Build
Sling IDE Tooling
Contract-driven development with OpenAPI 3 and Vert.x | DevNation Tech Talk
So how do I test my Sling application?
JavaDo#09 Spring boot入門ハンズオン
Sling IDE Tooling @ adaptTo 2013
The Past Year in Spring for Apache Geode
Ad

Similar to DevRock #01 What's new ASP.net 5 (20)

PPTX
ASP.NET Core 1.0
PPTX
Learning ASP.NET 5 and MVC 6
PPTX
.NET Core: a new .NET Platform
PPTX
Introducing ASP.NET Core 2.0
PPTX
Angular on ASP.NET MVC 6
PPTX
Blazor Full-Stack
PPTX
Modern .NET Apps - Telerik Webinar
PPTX
ASP.Net 5 and C# 6
PPTX
C#on linux
PDF
Learning Blazor (Fourth Early Release) David Pine
PPTX
ASP.NET Core: The best of the new bits
PPTX
.NET Conf 2019 高雄場 - .NET Core 3.0
PPTX
Quick Interview Preparation Dot Net Core
PDF
Asp.net core tutorial
PPTX
ASP.NET Core - Phillosophies, Processes and Tooling
PPTX
Microsoft ASP.NET 5 - The new kid on the block
PDF
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
PDF
White Paper : ASP.NET Core AngularJs 2 and Prime
PDF
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
PPTX
Whats new in .net core 3
ASP.NET Core 1.0
Learning ASP.NET 5 and MVC 6
.NET Core: a new .NET Platform
Introducing ASP.NET Core 2.0
Angular on ASP.NET MVC 6
Blazor Full-Stack
Modern .NET Apps - Telerik Webinar
ASP.Net 5 and C# 6
C#on linux
Learning Blazor (Fourth Early Release) David Pine
ASP.NET Core: The best of the new bits
.NET Conf 2019 高雄場 - .NET Core 3.0
Quick Interview Preparation Dot Net Core
Asp.net core tutorial
ASP.NET Core - Phillosophies, Processes and Tooling
Microsoft ASP.NET 5 - The new kid on the block
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
White Paper : ASP.NET Core AngularJs 2 and Prime
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Whats new in .net core 3
Ad

More from Chaowlert Chaisrichalermpol (8)

PPTX
Tuning a database for millions of users
PPTX
Front end development
PPTX
Introduction to Azure Machine Learning
PPTX
Mobile app on Azure
PPTX
PPT
PPTX
Azure Introduction
PPTX
Windows Azure Storage – Architecture View
Tuning a database for millions of users
Front end development
Introduction to Azure Machine Learning
Mobile app on Azure
Azure Introduction
Windows Azure Storage – Architecture View

Recently uploaded (20)

PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
System and Network Administraation Chapter 3
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
ai tools demonstartion for schools and inter college
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
Understanding Forklifts - TECH EHS Solution
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
CHAPTER 2 - PM Management and IT Context
Design an Analysis of Algorithms II-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Navsoft: AI-Powered Business Solutions & Custom Software Development
Odoo POS Development Services by CandidRoot Solutions
System and Network Administraation Chapter 3
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Reimagine Home Health with the Power of Agentic AI​
PTS Company Brochure 2025 (1).pdf.......
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Wondershare Filmora 15 Crack With Activation Key [2025
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Softaken Excel to vCard Converter Software.pdf
ai tools demonstartion for schools and inter college
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Upgrade and Innovation Strategies for SAP ERP Customers

DevRock #01 What's new ASP.net 5

  • 1. DevRock #01 Hello New Year 2015 ASP.NET 5 Chaowlert Chaisrichalermpol Developer @ Jetabroad
  • 2. DevRock #01 Hello New Year 2015 JETABOARD PRODUCTION
  • 3. DevRock #01 Hello New Year 2015 LEARN
  • 4. DevRock #01 Hello New Year 2015 ASP.NET 5 NEW PLATFORM  Unified MVC and WebAPI  New runtime, no more System.Web, or IIS, or Windows!  New project structure  New HTTP pipeline  New package management  Common IoC, and log interface + built-in IoC  New configuration & Options  New view features  New front-end workflow
  • 5. DevRock #01 Hello New Year 2015 OVERVIEW
  • 6. DevRock #01 Hello New Year 2015 LIBRARIES .Net full .Net Core WebForm 4.6 - MVC 5 MVC 6 (unified with WebAPI) WebAPI 2 EF 6 EF 7 + support for non-relational SignalR 2 SignalR 3
  • 7. DevRock #01 Hello New Year 2015 ASP.NET 5 MODULAR MVC Caching Config Data Protect DI FileLogging Options Razor Routing See more at https://github.com/aspnet/Home/wiki/Repo-List
  • 8. DevRock #01 Hello New Year 2015 ARCHITECTURE  New project type  Support new Core CLR  Self hosted
  • 9. DevRock #01 Hello New Year 2015 CORE CLR
  • 10. DevRock #01 Hello New Year 2015 CLR CORE CLR CLR Core CLR Install per machine Install per application 1 major version for all applications Run different version side by side Runtime 200 MB Runtime 11 MB (Only what you need) Host on Windows Host anywhere Normal performance Fast startup Lower memory usage (-35%)* More request per seconds Full backward compatibility Some backward compatibility * http://james.newtonking.com/archive/2014/10/24/json-net-6-0-release-6-asp-net-coreclr-support- memory-usage-optimizations
  • 11. DevRock #01 Hello New Year 2015 PROJECT STRUCTURE
  • 12. DevRock #01 Hello New Year 2015 PROJECT STUCTURE  No more global.asax & web.config  global.json  Startup.cs  wwwroot  project.json  Files in project always include by default
  • 13. DevRock #01 Hello New Year 2015 HTTP PIPELINE
  • 14. DevRock #01 Hello New Year 2015 HTTP PIPELINE  Lean & fast  app.Run()  app.Use… public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerfactory) { app.UseErrorHandler("/Home/Error"); app.UseStaticFiles(); app.UseIdentity(); app.UseMvc(routes => ...) }
  • 15. DevRock #01 Hello New Year 2015 CUSTOM public class SampleMiddleware { private readonly RequestDelegate next; public SampleMiddleware(RequestDelegate next) { this.next = next; } public async Task Invoke(HttpContext context) { await this.next.Invoke(context); } } app.UseMiddleware<SampleMiddleware>();
  • 16. DevRock #01 Hello New Year 2015 MVC public void ConfigureServices(IServiceCollection services) { service.AddMvc(); } public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerfactory) { app.UseMvc(routes => ...) }
  • 17. DevRock #01 Hello New Year 2015 PACKAGE MANAGEMENT
  • 18. DevRock #01 Hello New Year 2015 PACKAGE MANAGEMENT  Manage packages in project.json  No more Assembly references  Reference by NuGet  kpm  Packages are cached
  • 19. DevRock #01 Hello New Year 2015 LOG & IOC
  • 20. DevRock #01 Hello New Year 2015 LOG IOC  ILogger  Console  NLog  Serilog  Custom  IServiceProvider  Built-in  Autofac  Ninject  StructureMap  Unity  Windsor  Custom public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerfactory) { loggerfactory.AddNLog(new NLog.LogFactory()); } public IServiceProvider ConfigureServices(IServiceCollection services) { ... var builder = new ContainerBuilder(); builder.Populate(services); return builder.Build().Resolve<IServiceProvider>(); }
  • 21. DevRock #01 Hello New Year 2015 IOC  services.AddSingleton  services.AddScoped  services.AddTransient  services.AddInstance public void ConfigureServices(IServiceCollection services) { services.AddScoped<ICalculator, Calculator>(); }
  • 22. DevRock #01 Hello New Year 2015 CONFIGURATION & OPTIONS
  • 23. DevRock #01 Hello New Year 2015 CONFIGURATION  no more web.config  Config from multiple sources  Structure is hierarchy  Configuration source  config.AddJsonFile  config.AddXmlFile  config.AddIniFile  config.AddEnvironmentVariable  config.AddCommandLine  Get config value  config.Get IConfiguration config = new Configuration() .AddJsonFile("config.json") .AddEnvironmentVariable(); config.Get("path1:path2");
  • 24. DevRock #01 Hello New Year 2015 OPTIONS  Read from config is old school  Inject config as POCO  service.Configure<T>  IOptions<T> public void ConfigureServices(IServiceCollection services) { services.AddOptions(); services.Configure<MyAppOptions>(Config.GetSubKey("MyApp")); }
  • 25. DevRock #01 Hello New Year 2015 NEW VIEW FEATURES
  • 26. DevRock #01 Hello New Year 2015 VIEWCOMPONENT  Next step of PartialView  Behave like Controller  Razor views are located in  /Views/{controller}/Components/{component}/{view_name}.cshtml  /Views/Shared/Components/{component}/{view_name}.cshtml public class MyViewComponent : ViewComponent { public IViewComponentResult Invoke(param...) { return View(); } }
  • 27. DevRock #01 Hello New Year 2015 VIEW INJECTION @{ ViewBag.Title = "Home Page"; } <div>Value is @calc.Add(1, 1)</div> @inject ICalculator calc
  • 28. DevRock #01 Hello New Year 2015 TAGHELPERS  @HTML.Label("FirstName", "First Name:", new { @class = "caption" }) is unreadable  <label class="caption" for="FirstName">First Name:</label> is better public class DateTimePickerTagHelper : TagHelper { public override void Process(TagHelperContext context, TagHelperOutput output) { } } @addtaghelper "Assembly.Name" <datetimepicker id="myDate" value="@Model.StartDate"></datetimepicker>
  • 29. DevRock #01 Hello New Year 2015 FRON-END FRAMEWORK
  • 30. DevRock #01 Hello New Year 2015 BOWER  No more js library from NuGet  20,000+ packages  No more js collision  You decide what should include in project
  • 31. DevRock #01 Hello New Year 2015 GRUNT & GULP  No more ASP.net bundle  4,000+ tasks  Bind with Visual Studio  Before Build  After Build  Clean  Open
  • 32. DevRock #01 Hello New Year 2015 Q A