Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

ASP.NET Core Changes Every Developer Should Know

556 vues

Publié le

What are the key changes in ASP.NET MVC when .NET Core 1.0 is released? Let's find out in this tour of ASP.NET Core. We'll examine what's new, what's the same, and what's missing.

Publié dans : Technologie
  • Identifiez-vous pour voir les commentaires

  • Soyez le premier à aimer ceci

ASP.NET Core Changes Every Developer Should Know

  1. 1. ASP.NET Core MVC Changes Every Developer Should Know
  2. 2. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.2 About Me Ed Charbeneau  Developer Advocate for Progress, Telerik DevCraft  Developer.Telerik.com  Twitter @EdCharbeneau
  3. 3. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.3 .NET Core overview
  4. 4. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.4 Hello.NET Core 1.1.1  Cross platform • Development, Deployment • Windows, Mac, Linux  Current App Models • UWP • Console Applications • ASP.NET Core
  5. 5. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.5 Hello ASP.NET Core 1.1.1  vNext  ASP.NET 5  ASP.NET Core 1.1.1
  6. 6. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.6 Cross platform development DOTNET CLI Read more: http://developer.telerik.com/featured/net-cli-decoded/
  7. 7. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.7 Cross platform deployment
  8. 8. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.8 ASP.NET Core “MVC” overview
  9. 9. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.9 Just the FAQs  ASP.NET Core is a complete rewrite  MVC is a module for ASP.NET Core  MVC and Web API have merged into a single codebase  There is no longer an MVC 6, the module was reversioned to 1.0  There is no official plan for WebForms on .NET Core
  10. 10. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.10 Modularity  ASP.NET Core uses a request pipeline  Successor to HttpHandler  Read / Write directly to the HTTP Pipeline using middleware  MVC is ASP.NET Core middleware  Raw access to the HTTP request/response (A.k.a. the bare metal)  Built using Dependency Injection Pipeline HTTP Request HTTP Response middleware MVC middleware
  11. 11. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.11 No dependency on IIS  Remember, cross platform!  ASP.NET Core can be: • Self-hosted • Cloud hosted • Mac, Windows, Linux • Docker (integrated with VS2017)
  12. 12. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.12  cross-platform asynchronous I/O library  Should use Reverse Proxy Server  ASP.NET Core Module .UseIISIntegration() Servers Kestrel WebListener  Windows only  Direct connection to the Internet
  13. 13. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.13 File, New Project
  14. 14. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.14 What's (Mostly) the Same  MVC design pattern itself • Models • Views • Controller
  15. 15. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.15 What's Missing  App_Start  App_Data  Global.ASAX  /Scripts  /Content  Web.Config* * For IIS support only
  16. 16. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.16 ASP.NET Core 1.0 – 1.1 changes  /src  Project.json • In ASP.NET Core 1.0, this replaced .csproj • .csproj is back in 1.1 • 1.0 apps must to migrate to .csproj  Web.Config • For IIS support only
  17. 17. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.17 What’s new  /wwwroot  Dependencies  /Data/Migrations  Appsettings.json  Startup.cs  Program.cs  _ViewImports.cshtml
  18. 18. Visual Studio Demo
  19. 19. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.19 Application Initialization
  20. 20. ASP.NET Core is a Console Application
  21. 21. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.21 Application Initialization ASP.NET Core  No dependency on IIS  Initialized via command line  Program.Main() builds web host & invokes Startup  Startup.cs handles startup .NET Framework 4.6, ASP.NET  IIS (InetMgr.exe) initialized application  HttpApplication.Application_Start()  Startup code handled by Global.asax
  22. 22. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.22 Application Startup  Replaces App_Start, and Global.ASAX  Startup is called by WebHostBuilder.UseStartup Program.Main() ConfigureServices() Configure() Startup Startup()
  23. 23. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.23 New Configuration Options  Configuration options are resolved in the Startup constructor  Settings can be stored in .json, .xml or environment variables
  24. 24. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.24 Overloading Configuration Options Overloading  Dev Ops Friendly  Multiple configs • Development • Staging • Production  Last setting to be resolved wins Example var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile(“foo.json”) .AddJsonFile(“bar.json”); Configuration.GetValue<string>(“myKey”); //=> Bar
  25. 25. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.25 Startup methods ConfigureServices  Dependency Injection (DI) configured  IServiceCollection is the DI container  AddTransient<TService, TImplementation>();  services.AddMvc(); Configure  HTTP Middleware is added  IApplicationBuilder is the pipeline  app.UseMiddleware()  app.UseMvc(routes …)
  26. 26. Visual Studio Demo
  27. 27. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.27 TagHelpers
  28. 28. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.28 Overview  Augments HTML to include server-side code & values
  29. 29. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.29 Just the FAQs TagHelpers Are  Use tags and attributes like HTML  Rendered Server-Side  Supported by intellisense TagHelpers Are Not  Going to eliminate Razor @Html  Like WebForms
  30. 30. Visual Studio Demo
  31. 31. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.31
  32. 32. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.32 UI for ASP.NET Core  For ASP.NET Core  70+ ASP.NET MVC Components Powered by Kendo UI  Charts  Graphs  Grids  Schedulers  Responsive, works on any screen size
  33. 33. © 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.33 Polished UI for All your Apps http://telerik.com/devcraft
  34. 34. Thank you

×