Skip to content

Commit a01fec1

Browse files
authored
Fix formatting by removing unnecessary trailing spaces in best practices article (#36553)
1 parent d62d497 commit a01fec1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

aspnetcore/fundamentals/best-practices.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ A webpage shouldn't load large amounts of data all at once. When returning a col
5454

5555
For more information on paging and limiting the number of returned records, see:
5656

57-
* [Performance considerations](xref:data/ef-rp/intro#performance-considerations)
57+
* [Performance considerations](xref:data/ef-rp/intro#performance-considerations)
5858
* [Add paging to an ASP.NET Core app](xref:data/ef-rp/sort-filter-page#add-paging)
5959

6060
### Return `IEnumerable<T>` or `IAsyncEnumerable<T>`
@@ -186,7 +186,7 @@ In the preceding code, `Get` synchronously reads the entire HTTP request body in
186186
The preceding code asynchronously reads the entire HTTP request body into memory.
187187

188188
> [!WARNING]
189-
> If the request is large, reading the entire HTTP request body into memory could lead to an out of memory (OOM) condition. OOM can result in a Denial Of Service. For more information, see [Avoid reading large request bodies or response bodies into memory](#arlb) in this article.
189+
> If the request is large, reading the entire HTTP request body into memory could lead to an out of memory (OOM) condition. OOM can result in a Denial Of Service. For more information, see [Avoid reading large request bodies or response bodies into memory](#arlb) in this article.
190190
191191
**Do this:** The following example is fully asynchronous using a non-buffered request body:
192192

@@ -202,7 +202,7 @@ Use `HttpContext.Request.ReadFormAsync` instead of `HttpContext.Request.Form`.
202202
* The form has been read by a call to `ReadFormAsync`, and
203203
* The cached form value is being read using `HttpContext.Request.Form`
204204

205-
**Do not do this:** The following example uses `HttpContext.Request.Form`. `HttpContext.Request.Form` uses [sync over async](https://devblogs.microsoft.com/pfxteam/should-i-expose-synchronous-wrappers-for-asynchronous-methods/) and can lead to thread pool starvation.
205+
**Do not do this:** The following example uses `HttpContext.Request.Form`. `HttpContext.Request.Form` uses [sync over async](https://devblogs.microsoft.com/pfxteam/should-i-expose-synchronous-wrappers-for-asynchronous-methods/) and can lead to thread pool starvation.
206206

207207
[!code-csharp[](~/performance/performance-best-practices/samples/3.0/Controllers/MySecondController.cs?name=snippet1)]
208208

@@ -230,12 +230,12 @@ Storing a large request or response body into a single `byte[]` or `string`:
230230

231231
## Working with a synchronous data processing API
232232

233-
When using a serializer/de-serializer that only supports synchronous reads and writes (for example, [Json.NET](https://www.newtonsoft.com/json/help/html/Introduction.htm)):
233+
When using a serializer/de-serializer that only supports synchronous reads and writes (for example, [Json.NET](https://www.newtonsoft.com/json/help/html/Introduction.htm)):
234234

235235
* Buffer the data into memory asynchronously before passing it into the serializer/de-serializer.
236236

237237
> [!WARNING]
238-
> If the request is large, it could lead to an out of memory (OOM) condition. OOM can result in a Denial Of Service. For more information, see [Avoid reading large request bodies or response bodies into memory](#arlb) in this article.
238+
> If the request is large, it could lead to an out of memory (OOM) condition. OOM can result in a Denial Of Service. For more information, see [Avoid reading large request bodies or response bodies into memory](#arlb) in this article.
239239
240240
ASP.NET Core 3.0 uses <xref:System.Text.Json> by default for JSON serialization. <xref:System.Text.Json>:
241241

@@ -308,7 +308,7 @@ Background tasks should be implemented as hosted services. For more information,
308308

309309
## Do not capture services injected into the controllers on background threads
310310

311-
**Do not do this:** The following example shows a closure that is capturing the `DbContext` from the `Controller` action parameter. This is a bad practice. The work item could run outside of the request scope. The `ContosoDbContext` is scoped to the request, resulting in an `ObjectDisposedException`.
311+
**Do not do this:** The following example shows a closure that is capturing the `DbContext` from the `Controller` action parameter. This is a bad practice. The work item could run outside of the request scope. The `ContosoDbContext` is scoped to the request, resulting in an `ObjectDisposedException`.
312312

313313
[!code-csharp[](~/performance/performance-best-practices/samples/3.0/Controllers/FireAndForgetSecondController.cs?name=snippet1)]
314314

0 commit comments

Comments
 (0)