4. Next gen JIT (RyuJIT)
SIMD
Runtime
Components Compilers
.NET Compiler Platform (Roslyn)
Languages innovation
.NET Core 5 Libraries
.NET Framework 4.6 Libraries
NuGet
packages
5.
6.
7.
8.
9.
10.
11.
12. • New flexible and cross-platform runtime
• New modular HTTP request pipeline
• Cloud-ready environment configuration
• Unified programming model that combines MVC,
Web API, and Web Pages
13. • Ability to see changes without re-building the
project
• Side-by-side versioning of the .NET Framework
• Ability to self-host or host on IIS
• New tools in Visual Studio 2015
• Open source in GitHub
20. Introduction to ASP.NET MVC
Developing ASP.NET MVC Applications Jump Start
Implementing Entity Framework with MVC
Programming in C# Jump Start
And many more: Azure, mobile apps, games…
Notas do Editor
Introduction to ASP.NET MVC
http://www.microsoftvirtualacademy.com/training-courses/introduction-to-asp-net-mvc
DEMOS
http://aka.ms/mva-mvc-source
Introduction to ASP.NET MVC
http://www.microsoftvirtualacademy.com/training-courses/introduction-to-asp-net-mvc
DEMOS
http://aka.ms/mva-mvc-source
ASP.NET vNext
http://www.asp.net/vnext
Introducing ASP.NET 5
https://weblogs.asp.net/scottgu/introducing-asp-net-5
What's New with ASP.NET 5
http://www.microsoftvirtualacademy.com/training-courses/what-s-new-with-asp-net-5
ASP.NET 5 GitHub
https://github.com/aspnet/home
Bower is a package manager for client-side libraries, including both JavaScript and CSS libraries.
Grunt and Gulp are task runners, which help you to automate your web development workflow. You can use Grunt or Gulp for tasks like compiling LESS, CoffeeScript, or TypeScript files, running JSLint, or minifying JavaScript files.
ASP.NET vNext
http://www.asp.net/vnext
Introducing ASP.NET 5
https://weblogs.asp.net/scottgu/introducing-asp-net-5
What's New with ASP.NET 5
http://www.microsoftvirtualacademy.com/training-courses/what-s-new-with-asp-net-5
ASP.NET 5 GitHub
https://github.com/aspnet/home
Bower is a package manager for client-side libraries, including both JavaScript and CSS libraries.
Grunt and Gulp are task runners, which help you to automate your web development workflow. You can use Grunt or Gulp for tasks like compiling LESS, CoffeeScript, or TypeScript files, running JSLint, or minifying JavaScript files.
What is EF7 all about?
https://github.com/aspnet/EntityFramework/wiki/What-is-EF7-all-about
Entity Framework GitHub
https://github.com/aspnet/EntityFramework
ASP.NET vNext
http://www.asp.net/vnext
Introducing ASP.NET 5
https://weblogs.asp.net/scottgu/introducing-asp-net-5
What's New with ASP.NET 5
http://www.microsoftvirtualacademy.com/training-courses/what-s-new-with-asp-net-5
ASP.NET 5 GitHub
https://github.com/aspnet/home
Bower is a package manager for client-side libraries, including both JavaScript and CSS libraries.
Grunt and Gulp are task runners, which help you to automate your web development workflow. You can use Grunt or Gulp for tasks like compiling LESS, CoffeeScript, or TypeScript files, running JSLint, or minifying JavaScript files.
What is EF7 all about?
https://github.com/aspnet/EntityFramework/wiki/What-is-EF7-all-about
Entity Framework GitHub
https://github.com/aspnet/EntityFramework
http://www.asp.net/mvc
MVC stands for model-view-controller. MVC is a pattern for developing applications that are well architected, testable and easy to maintain. MVC-based applications contain:
Models: Classes that represent the data of the application and that use validation logic to enforce business rules for that data.
Views: Template files that your application uses to dynamically generate HTML responses.
Controllers: Classes that handle incoming browser requests, retrieve model data, and then specify view templates that return a response to the browser.
What does ASP.NET MVC value?
Absolute control of HTML markup
Supports Unit Testing, TDD and Agile methodologies
Extremely flexible and extensible
Model Binding
Controllers are classes
Actions are methods
Methods take parameters
MVC will convert forms to parameters
View Model
Differences between domain and user interface
Complex data
Dropdown lists
Unrelated objects
DEMOS
http://aka.ms/mva-mvc-source
Entity Framework
www.asp.net/entity-framework
Entity Framework (EF) is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. It eliminates the need for most of the data-access code that developers usually need to write.
Context == Database state (DbContext, DbSet).
Code First == Create the model first.
Relations / Foreign Keys: Mark relationships with virtual objects (lazy loading), and add their Ids for foreign keys.
Seed method == Insert data when app starts up (e.g. test data).
Migrations == Keep my model and database in sync.
Code First Migrations
https://msdn.microsoft.com/en-us/data/jj591621.aspx
Browser Link: work with several browsers at the same time and update all of them at once when you change something in your code.
Zen Coding: automatic HTML generation (e.g. write div.jumbotron and press Tab Tab, and it generates the DIV in HTML)
VS is a great web editor with e.g. IntelliSense for JavaScript and CSS.
Web Essentials is an extensión we can use to inspect our HTML to find the related code, make modifications to our HTML directly in the browser, detect unused CSS, etc.
http://vswebessentials.com
Side Waffle is an extension that adds any kind of web file to our project.
http://sidewaffle.com
DEMOS
http://aka.ms/mva-mvc-source
Actions
Creating an action involves adding a method to a controller class.
Parameters: Normal params, MVC Model Binding
ActionResult: FileResult, JsonResult, ViewResult
Create/Update/Delete are typically two step operations
Present the form
Accept the input
Create two actions
Form presentation via HttpGet (default)
Accept data via HttpPost
Model Binding
Default Model Binder just works. Uses the name attribute of input elements.
Custom binding can be done via bind attribute (simplest), view model (best) or custom model binders (not recommended).
Filters
Filters are attributes that decorate controllers and actions and alter execution.
MVC contains several built-in filters.
Often used in lieu of updating web.config.
A filter can execute pre-execution code and post-execution code.
Filtering in ASP.NET MVC
https://msdn.microsoft.com/en-us/library/gg416513(VS.98).aspx
Security Filters
Authorize attribute
Control who can access a controller/action
Properties
Users
Roles
ValidateAntiForgeryToken
Defends against cross-site request forgery
Requires anti-forgery token to be added to view
RequireHttps
Requires SSL
SSL
Encrypts traffic and prevents tampering
Authenticates server
When to use SSL
Asking for sensitive information
After authentication
Vanity URLs
www.mymusicstore.com/App/Album/Details/Display.aspx?ID=42&BandID=64
Vs.
www.mymusicstore.com/Album/Cure/Wish
MVC Routing
Action: Route attribute
Controller: RoutePrefix attribute
Global: RouteConfig.cs
DEMOS
http://aka.ms/mva-mvc-source
Finding Views
Views reside in the Views folder.
Subfolders:
Name of the controller
Shared
Views and Models
Views have a Model property.
Type is set by @model declaration.
Advanced note:
Views do not need to have a typed model.
Useful for creating dynamic views.
Razor Syntax
@ indicates server-side code.
MVC runtime determines meaning of @ based on context.
HTMLHelper
Helps generate HTML.
Uses attributes on model:
Display names
Formatting
Input elements
@Html.DisplayFor(model => model.Name)
DisplayNameFor
DisplayName attribute
Display attribute, Name property
DisplayFor
Uses DisplayFormat (if applicable)
Creating Forms
HtmlHelper.BeginForm()
Why not just use a form element? URLs can always change
Parameters
Action name
Controller name
Form method
Get
Post
Accepting input
LabelFor
Creates a label element
Useful for touch
InputFor
Creates input element
Uses HTML5 based on DataType attribute
Validation
ValidationMessageFor
Display error message next to text box
ValidationSummary
Display all error messages in one location
Layouts
Use layouts to ensure consistent page structure.
Layout methods:
RenderBody()
Renders anything in a view not in a section
RenderSection(name, required)
Allow views to add specific sections
Scripts
Banners
Sidebars
Use @section name to create section in view
DEMOS
http://aka.ms/mva-mvc-source
The most popular front-end framework for developing responsive, mobile first projects on the web.
30 day series on Bootstrap and the MVC Framework
http://jameschambers.com/2014/06/day-1-the-mvc-5-starter-project
Features
Theme Support http://bootswatch.com/
Responsive
Grid
Components
Pagination
Buttons
Modal (e.g. alerts)
Glyphicons
Great Visual Studio support: Class IntelliSense, Missing Class Detection
10 Lightweight Alternatives To Bootstrap & Foundation
http://www.hongkiat.com/blog/bootstrap-alternatives/
DEMOS
http://aka.ms/mva-mvc-source
Setting up AngularJS for ASP.Net MVC n WebAPI project
http://blog.technovert.com/2013/12/setting-up-angularjs-for-asp-net-mvc-n-webapi-project/
http://asp.net/identity
Microsoft ASP.NET Identity Samples
https://www.nuget.org/packages/Microsoft.AspNet.Identity.Samples/
ASP.NET Identity
One ASP.NET Identity system
Ease of plugging in profile data about the user
Persistence control
Unit testability
Role provider
Claims Based
Social Login Providers
Windows Azure Active Directory
OWIN Integration
NuGet package
Terminology
Identity / Credentials
Authentication (Who you are) / Authorization (What you are allowed to do)
Roles / Claims (Claims can carry rich information. They are a superset of roles)
Two Factor Authentication (2FA)
Passive / Active Protocols
Identities & Scenarios & Technologies
Individual User Accounts.
Internet apps, small and medium businesses, consumer apps.
If they go to your database, they are individual accounts.
ASP.NET Identity, Social Providers.
One ASP.NET Identity System
Many new features in ASP.NET Identity 2.0 such as 2FA.
Active Directory (AD).
On-premises enterprise apps and users (LAN/VPN).
IIS + Windows Auhtentication.
Active Directory Federation Services (ADFS).
On-premises enterprise apps with remote users.
WS-Federation middleware (Passive)
Oauth 2 middleware (Active)
Azure Active Directory (ADD).
Cloud-based enterprise apps.
Same technology as for ADFS.
OpenID Connect
Identity 2.0
Two-Factor Authentication
Account Lockout
Account confirmation
Password reset
Sign-out everywhere
Enhanced password validator
IQueryable for users and roles
ASP.NET Identity and External Providers
Why force users to create yet another identity?
ASP.NET Identity supports external social providers(Facebook, Google, Microsoft, Twitter)
Pluggable using OWIN middlewares
Supports storing additional user information
Single user can have multiple social identities
ASP.NET Extensibility
Profile
Quick look at extensibility options
DEMOS
http://aka.ms/mva-mvc-source
Microsoft ASP.NET Identity Samples
https://www.nuget.org/packages/Microsoft.AspNet.Identity.Samples/
OWIN (Open Web Interface for .NET)
http://owin.org/
OWIN defines a standard interface between .NET web servers and web applications.
Katana Project
http://katanaproject.codeplex.com/documentation
Katana is a flexible set of components for building and hosting Open Web Interface for .NET (OWIN)-based web applications.
OWIN and Katana overview
http://www.asp.net/aspnet/overview/owin-and-katana
Project Katana cloud optimizes your ASP.NET applications.
Third party frameworks can seamlessly run on Microsoft servers while Microsoft frameworks can potentially run on third party servers and hosts
Host
IIS/ASP.NET
Custom
OwinHost.exe
Server
Microsoft.Owin.Host.SystemWeb
Microsoft.Owin.Host.HttpListener
Middleware/framework
When the server accepts a request from a client, it is responsible for passing it through a pipeline of OWIN components, which are specified by the developer’s startup code. These pipeline components are known as middleware.
Middleware components can range in complexity from simple loggers to entire frameworks like ASP.NET, Web API, or SignalR
DEMOS
http://aka.ms/mva-mvc-source
Walkthrough: Organizing an ASP.NET MVC Application using Areas
https://msdn.microsoft.com/es-es/library/ee671793(v=vs.100).aspx
DEMOS
http://aka.ms/mva-mvc-source
Cursos MVA
http://msdn.microsoft.com/es-es/dn802822
Introduction to ASP.NET MVC
http://www.microsoftvirtualacademy.com/training-courses/introduction-to-asp-net-mvc
Developing ASP.NET MVC 4 Web Applications Jump Start
http://www.microsoftvirtualacademy.com/training-courses/developing-asp-net-mvc-4-web-applications-jump-start
What's New with ASP.NET 5
http://www.microsoftvirtualacademy.com/training-courses/what-s-new-with-asp-net-5
ASP.NET MVC for Java Developers
http://www.microsoftvirtualacademy.com/liveevents/mvc-for-java-developers
Implementing Entity Framework with MVC
http://www.microsoftvirtualacademy.com/training-courses/implementing-entity-framework-with-mvc
Customizing ASP.NET Authentication with Identity
http://www.microsoftvirtualacademy.com/training-courses/customizing-asp-net-authentication-with-identity
C# Fundamentals for Absolute Beginners
http://www.microsoftvirtualacademy.com/training-courses/c-fundamentals-for-absolute-beginners
Programming in C# Jump Start
http://www.microsoftvirtualacademy.com/training-courses/developer-training-with-programming-in-c