You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internally, the generated property (`DataRepository`) is decorated with the `InjectAttribute` attribute. Typically, this attribute isn't used directly. If a base class is required for components and injected properties are also required for the base class, manually add the `InjectAttribute`:
82
+
Internally, the generated property (`DataRepository`) uses the `InjectAttribute` attribute. Typically, this attribute isn't used directly. If a base class is required for components and injected properties are also required for the base class, manually add the `InjectAttribute`:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/lifecycle.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how to use Razor component lifecycle methods in ASP.NET Core
5
5
monikerRange: '>= aspnetcore-3.0'
6
6
ms.author: riande
7
7
ms.custom: mvc
8
-
ms.date: 11/26/2019
8
+
ms.date: 12/05/2019
9
9
no-loc: [Blazor]
10
10
uid: blazor/lifecycle
11
11
---
@@ -57,7 +57,7 @@ public override async Task SetParametersAsync(ParameterView parameters)
57
57
58
58
<xref:Microsoft.AspNetCore.Components.ParameterView> contains the entire set of parameter values each time `SetParametersAsync` is called.
59
59
60
-
The default implementation of `SetParametersAsync` sets the value of each property decorated with the `[Parameter]` or `[CascadingParameter]` attribute that has a corresponding value in the `ParameterView`. Parameters that don't have a corresponding value in `ParameterView` are left unchanged.
60
+
The default implementation of `SetParametersAsync` sets the value of each property with the `[Parameter]` or `[CascadingParameter]` attribute that has a corresponding value in the `ParameterView`. Parameters that don't have a corresponding value in `ParameterView` are left unchanged.
61
61
62
62
If `base.SetParametersAync` isn't invoked, the custom code can interpret the incoming parameters value in any way required. For example, there's no requirement to assign the incoming parameters to the properties on the class.
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/error-handling.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Discover how to handle errors in ASP.NET Core apps.
5
5
monikerRange: '>= aspnetcore-2.1'
6
6
ms.author: riande
7
7
ms.custom: mvc
8
-
ms.date: 10/08/2019
8
+
ms.date: 12/05/2019
9
9
uid: fundamentals/error-handling
10
10
---
11
11
# Handle errors in ASP.NET Core
@@ -59,7 +59,7 @@ public IActionResult Error()
59
59
}
60
60
```
61
61
62
-
Don't decorate the error handler action method with HTTP method attributes, such as `HttpGet`. Explicit verbs prevent some requests from reaching the method. Allow anonymous access to the method so that unauthenticated users are able to receive the error view.
62
+
Don't mark the error handler action method with HTTP method attributes, such as `HttpGet`. Explicit verbs prevent some requests from reaching the method. Allow anonymous access to the method so that unauthenticated users are able to receive the error view.
Copy file name to clipboardExpand all lines: aspnetcore/mobile/native-mobile-backend.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Create backend services for native mobile apps with ASP.NET Core
3
3
author: ardalis
4
4
description: Learn how to create backend services using ASP.NET Core MVC to support native mobile apps.
5
5
ms.author: riande
6
-
ms.date: 10/14/2016
6
+
ms.date: 12/05/2019
7
7
uid: mobile/native-mobile-backend
8
8
---
9
9
# Create backend services for native mobile apps with ASP.NET Core
@@ -57,7 +57,7 @@ The application should respond to all requests made to port 5000. Update *Progra
57
57
> [!NOTE]
58
58
> Make sure you run the application directly, rather than behind IIS Express, which ignores non-local requests by default. Run [dotnet run](/dotnet/core/tools/dotnet-run) from a command prompt, or choose the application name profile from the Debug Target dropdown in the Visual Studio toolbar.
59
59
60
-
Add a model class to represent To-Do items. Mark required fields using the `[Required]` attribute:
60
+
Add a model class to represent To-Do items. Mark required fields with the `[Required]` attribute:
@@ -102,7 +102,7 @@ You can test your new API method using a variety of tools, such as [Postman](htt
102
102
103
103
### Creating Items
104
104
105
-
By convention, creating new data items is mapped to the HTTP POST verb. The `Create` method has an `[HttpPost]` attribute applied to it, and accepts a `ToDoItem` instance. Since the `item` argument will be passed in the body of the POST, this parameter is decorated with the `[FromBody]` attribute.
105
+
By convention, creating new data items is mapped to the HTTP POST verb. The `Create` method has an `[HttpPost]` attribute applied to it and accepts a `ToDoItem` instance. Since the `item` argument is passed in the body of the POST, this parameter specifies the `[FromBody]` attribute.
106
106
107
107
Inside the method, the item is checked for validity and prior existence in the data store, and if no issues occur, it's added using the repository. Checking `ModelState.IsValid` performs [model validation](../mvc/models/validation.md), and should be done in every API method that accepts user input.
Copy file name to clipboardExpand all lines: aspnetcore/mvc/controllers/actions.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Handle requests with controllers in ASP.NET Core MVC
3
3
author: ardalis
4
4
description:
5
5
ms.author: riande
6
-
ms.date: 07/03/2017
6
+
ms.date: 12/05/2019
7
7
uid: mvc/controllers/actions
8
8
---
9
9
# Handle requests with controllers in ASP.NET Core MVC
@@ -17,13 +17,15 @@ Controllers, actions, and action results are a fundamental part of how developer
17
17
A controller is used to define and group a set of actions. An action (or *action method*) is a method on a controller which handles requests. Controllers logically group similar actions together. This aggregation of actions allows common sets of rules, such as routing, caching, and authorization, to be applied collectively. Requests are mapped to actions through [routing](xref:mvc/controllers/routing).
18
18
19
19
By convention, controller classes:
20
-
* Reside in the project's root-level *Controllers* folder
21
-
* Inherit from `Microsoft.AspNetCore.Mvc.Controller`
20
+
21
+
* Reside in the project's root-level *Controllers* folder.
22
+
* Inherit from `Microsoft.AspNetCore.Mvc.Controller`.
22
23
23
24
A controller is an instantiable class in which at least one of the following conditions is true:
24
-
* The class name is suffixed with "Controller"
25
-
* The class inherits from a class whose name is suffixed with "Controller"
26
-
* The class is decorated with the `[Controller]` attribute
25
+
26
+
* The class name is suffixed with `Controller`.
27
+
* The class inherits from a class whose name is suffixed with `Controller`.
28
+
* The `[Controller]` attribute is applied to the class.
27
29
28
30
A controller class must not have an associated `[NonController]` attribute.
29
31
@@ -37,7 +39,7 @@ The controller is a *UI-level* abstraction. Its responsibilities are to ensure r
37
39
38
40
## Defining Actions
39
41
40
-
Public methods on a controller, except those decorated with the `[NonAction]` attribute, are actions. Parameters on actions are bound to request data and are validated using [model binding](xref:mvc/models/model-binding). Model validation occurs for everything that's model-bound. The `ModelState.IsValid` property value indicates whether model binding and validation succeeded.
42
+
Public methods on a controller, except those with the `[NonAction]` attribute, are actions. Parameters on actions are bound to request data and are validated using [model binding](xref:mvc/models/model-binding). Model validation occurs for everything that's model-bound. The `ModelState.IsValid` property value indicates whether model binding and validation succeeded.
41
43
42
44
Action methods should contain logic for mapping a request to a business concern. Business concerns should typically be represented as services that the controller accesses through [dependency injection](xref:mvc/controllers/dependency-injection). Actions then map the result of the business action to an application state.
Copy file name to clipboardExpand all lines: aspnetcore/mvc/controllers/application-model.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Work with the application model in ASP.NET Core
3
3
author: ardalis
4
4
description: Learn how to read and manipulate the application model to modify how MVC elements behave in ASP.NET Core.
5
5
ms.author: riande
6
-
ms.date: 10/14/2016
6
+
ms.date: 12/05/2019
7
7
uid: mvc/controllers/application-model
8
8
---
9
9
# Work with the application model in ASP.NET Core
@@ -190,7 +190,7 @@ The `UseWebApiParameterConventionsAttribute` is used to apply the `WebApiParamet
190
190
191
191
The `UseWebApiRoutesAttribute` controls whether the `WebApiApplicationModelConvention` controller convention is applied. When enabled, this convention is used to add support for [areas](xref:mvc/controllers/areas) to the route.
192
192
193
-
In addition to a set of conventions, the compatibility package includes a `System.Web.Http.ApiController` base class that replaces the one provided by Web API. This allows your controllers written for Web API and inheriting from its `ApiController` to work as they were designed, while running on ASP.NET Core MVC. This base controller class is decorated with all of the `UseWebApi*` attributes listed above. The `ApiController` exposes properties, methods, and result types that are compatible with those found in Web API.
193
+
In addition to a set of conventions, the compatibility package includes a `System.Web.Http.ApiController` base class that replaces the one provided by Web API. This allows your controllers written for Web API and inheriting from its `ApiController` to work as they were designed, while running on ASP.NET Core MVC. All of the `UseWebApi*` attributes listed earlier are applied to the base controller class. The `ApiController` exposes properties, methods, and result types that are compatible with those found in Web API.
Copy file name to clipboardExpand all lines: aspnetcore/mvc/controllers/areas.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Areas in ASP.NET Core
3
3
author: rick-anderson
4
4
description: Learn how Areas are an ASP.NET MVC feature used to organize related functionality into a group as a separate namespace (for routing) and folder structure (for views).
5
5
ms.author: riande
6
-
ms.date: 08/16/2019
6
+
ms.date: 12/05/2019
7
7
uid: mvc/controllers/areas
8
8
---
9
9
# Areas in ASP.NET Core
@@ -28,7 +28,7 @@ If you're using Razor Pages, see [Areas with Razor Pages](#areas-with-razor-page
28
28
A typical ASP.NET Core web app using areas, controllers, and views contains the following:
29
29
30
30
* An [Area folder structure](#area-folder-structure).
31
-
* Controllers decorated with the [[Area]](#attribute) attribute to associate the controller with the area:
31
+
* Controllers with the [[Area]](#attribute) attribute to associate the controller with the area:
Copy file name to clipboardExpand all lines: aspnetcore/mvc/controllers/routing.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Routing to controller actions in ASP.NET Core
3
3
author: rick-anderson
4
4
description: Learn how ASP.NET Core MVC uses Routing Middleware to match URLs of incoming requests and map them to actions.
5
5
ms.author: riande
6
-
ms.date: 01/24/2019
6
+
ms.date: 12/05/2019
7
7
uid: mvc/controllers/routing
8
8
---
9
9
# Routing to controller actions in ASP.NET Core
@@ -330,7 +330,7 @@ public class ProductsApiController : Controller
330
330
}
331
331
```
332
332
333
-
In this example the URL path `/products` can match `ProductsApi.ListProducts`, and the URL path `/products/5` can match `ProductsApi.GetProduct(int)`. Both of these actions only match HTTP `GET` because they're decorated with the `HttpGetAttribute`.
333
+
In this example the URL path `/products` can match `ProductsApi.ListProducts`, and the URL path `/products/5` can match `ProductsApi.GetProduct(int)`. Both of these actions only match HTTP `GET` because they're marked with the `HttpGetAttribute`.
334
334
335
335
Route templates applied to an action that begin with `/` or `~/` don't get combined with route templates applied to the controller. This example matches a set of URL paths similar to the *default route*.
Copy file name to clipboardExpand all lines: aspnetcore/mvc/views/overview.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Views in ASP.NET Core MVC
3
3
author: ardalis
4
4
description: Learn how views handle the app's data presentation and user interaction in ASP.NET Core MVC.
5
5
ms.author: riande
6
-
ms.date: 04/03/2019
6
+
ms.date: 12/05/2019
7
7
uid: mvc/views/overview
8
8
---
9
9
# Views in ASP.NET Core MVC
@@ -246,9 +246,9 @@ Work with the data in a view:
246
246
247
247
**ViewData attribute**
248
248
249
-
Another approach that uses the [ViewDataDictionary](/dotnet/api/microsoft.aspnetcore.mvc.viewfeatures.viewdatadictionary) is [ViewDataAttribute](/dotnet/api/microsoft.aspnetcore.mvc.viewdataattribute). Properties on controllers or Razor Page models decorated with `[ViewData]` have their values stored and loaded from the dictionary.
249
+
Another approach that uses the [ViewDataDictionary](/dotnet/api/microsoft.aspnetcore.mvc.viewfeatures.viewdatadictionary) is [ViewDataAttribute](/dotnet/api/microsoft.aspnetcore.mvc.viewdataattribute). Properties on controllers or Razor Page models marked with the `[ViewData]` attribute have their values stored and loaded from the dictionary.
250
250
251
-
In the following example, the Home controller contains a `Title` property decorated with `[ViewData]`. The `About` method sets the title for the About view:
251
+
In the following example, the Home controller contains a `Title` property marked with `[ViewData]`. The `About` method sets the title for the About view:
0 commit comments