Skip to content

Commit faf0363

Browse files
authored
Drop 'decorate'/'decorated' for attribute (dotnet#16039)
1 parent f284e46 commit faf0363

File tree

24 files changed

+63
-61
lines changed

24 files changed

+63
-61
lines changed

aspnetcore/blazor/dependency-injection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: See how Blazor apps can inject services into components.
55
monikerRange: '>= aspnetcore-3.0'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 11/27/2019
8+
ms.date: 12/05/2019
99
no-loc: [Blazor]
1010
uid: blazor/dependency-injection
1111
---
@@ -79,7 +79,7 @@ The following example shows how to use `@inject`. The service implementing `Serv
7979

8080
[!code-cshtml[](dependency-injection/samples_snapshot/3.x/CustomerList.razor?highlight=2-3,23)]
8181

82-
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`:
8383

8484
```csharp
8585
public class ComponentBase : IComponent

aspnetcore/blazor/lifecycle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use Razor component lifecycle methods in ASP.NET Core
55
monikerRange: '>= aspnetcore-3.0'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 11/26/2019
8+
ms.date: 12/05/2019
99
no-loc: [Blazor]
1010
uid: blazor/lifecycle
1111
---
@@ -57,7 +57,7 @@ public override async Task SetParametersAsync(ParameterView parameters)
5757

5858
<xref:Microsoft.AspNetCore.Components.ParameterView> contains the entire set of parameter values each time `SetParametersAsync` is called.
5959

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.
6161

6262
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.
6363

aspnetcore/fundamentals/error-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Discover how to handle errors in ASP.NET Core apps.
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 10/08/2019
8+
ms.date: 12/05/2019
99
uid: fundamentals/error-handling
1010
---
1111
# Handle errors in ASP.NET Core
@@ -59,7 +59,7 @@ public IActionResult Error()
5959
}
6060
```
6161

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.
6363

6464
### Access the exception
6565

aspnetcore/migration/webapi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: ardalis
44
description: Learn how to migrate a web API implementation from ASP.NET 4.x Web API to ASP.NET Core MVC.
55
ms.author: scaddie
66
ms.custom: mvc
7-
ms.date: 12/10/2018
7+
ms.date: 12/05/2019
88
uid: migration/webapi
99
---
1010
# Migrate from ASP.NET Web API to ASP.NET Core
@@ -91,7 +91,7 @@ return product;
9191

9292
Configure routing as follows:
9393

94-
1. Decorate the `ProductsController` class with the following attributes:
94+
1. Mark the `ProductsController` class with the following attributes:
9595

9696
```csharp
9797
[Route("api/[controller]")]

aspnetcore/mobile/native-mobile-backend.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create backend services for native mobile apps with ASP.NET Core
33
author: ardalis
44
description: Learn how to create backend services using ASP.NET Core MVC to support native mobile apps.
55
ms.author: riande
6-
ms.date: 10/14/2016
6+
ms.date: 12/05/2019
77
uid: mobile/native-mobile-backend
88
---
99
# 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
5757
> [!NOTE]
5858
> 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.
5959
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:
6161

6262
[!code-csharp[](native-mobile-backend/sample/ToDoApi/src/ToDoApi/Models/ToDoItem.cs)]
6363

@@ -102,7 +102,7 @@ You can test your new API method using a variety of tools, such as [Postman](htt
102102

103103
### Creating Items
104104

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.
106106

107107
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.
108108

aspnetcore/mvc/controllers/actions.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Handle requests with controllers in ASP.NET Core MVC
33
author: ardalis
44
description:
55
ms.author: riande
6-
ms.date: 07/03/2017
6+
ms.date: 12/05/2019
77
uid: mvc/controllers/actions
88
---
99
# 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
1717
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).
1818

1919
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`.
2223

2324
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.
2729

2830
A controller class must not have an associated `[NonController]` attribute.
2931

@@ -37,7 +39,7 @@ The controller is a *UI-level* abstraction. Its responsibilities are to ensure r
3739

3840
## Defining Actions
3941

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.
4143

4244
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.
4345

aspnetcore/mvc/controllers/application-model.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Work with the application model in ASP.NET Core
33
author: ardalis
44
description: Learn how to read and manipulate the application model to modify how MVC elements behave in ASP.NET Core.
55
ms.author: riande
6-
ms.date: 10/14/2016
6+
ms.date: 12/05/2019
77
uid: mvc/controllers/application-model
88
---
99
# Work with the application model in ASP.NET Core
@@ -190,7 +190,7 @@ The `UseWebApiParameterConventionsAttribute` is used to apply the `WebApiParamet
190190

191191
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.
192192

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.
194194

195195
## Using ApiExplorer to Document Your App
196196

aspnetcore/mvc/controllers/areas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Areas in ASP.NET Core
33
author: rick-anderson
44
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).
55
ms.author: riande
6-
ms.date: 08/16/2019
6+
ms.date: 12/05/2019
77
uid: mvc/controllers/areas
88
---
99
# Areas in ASP.NET Core
@@ -28,7 +28,7 @@ If you're using Razor Pages, see [Areas with Razor Pages](#areas-with-razor-page
2828
A typical ASP.NET Core web app using areas, controllers, and views contains the following:
2929

3030
* An [Area folder structure](#area-folder-structure).
31-
* Controllers decorated with the [&lbrack;Area&rbrack;](#attribute) attribute to associate the controller with the area:
31+
* Controllers with the [[Area]](#attribute) attribute to associate the controller with the area:
3232

3333
[!code-csharp[](areas/samples/MVCareas/Areas/Products/Controllers/ManageController.cs?name=snippet2)]
3434

aspnetcore/mvc/controllers/routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Routing to controller actions in ASP.NET Core
33
author: rick-anderson
44
description: Learn how ASP.NET Core MVC uses Routing Middleware to match URLs of incoming requests and map them to actions.
55
ms.author: riande
6-
ms.date: 01/24/2019
6+
ms.date: 12/05/2019
77
uid: mvc/controllers/routing
88
---
99
# Routing to controller actions in ASP.NET Core
@@ -330,7 +330,7 @@ public class ProductsApiController : Controller
330330
}
331331
```
332332

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`.
334334

335335
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*.
336336

aspnetcore/mvc/views/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Views in ASP.NET Core MVC
33
author: ardalis
44
description: Learn how views handle the app's data presentation and user interaction in ASP.NET Core MVC.
55
ms.author: riande
6-
ms.date: 04/03/2019
6+
ms.date: 12/05/2019
77
uid: mvc/views/overview
88
---
99
# Views in ASP.NET Core MVC
@@ -246,9 +246,9 @@ Work with the data in a view:
246246

247247
**ViewData attribute**
248248

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.
250250

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:
252252

253253
```csharp
254254
public class HomeController : Controller

0 commit comments

Comments
 (0)