Skip to content

Commit

Permalink
ConfigureAwait(true)
Browse files Browse the repository at this point in the history
ConfigureAwait(true)
  • Loading branch information
Oktawian-L committed Nov 9, 2019
1 parent f9cf761 commit cc99f0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions SubitonAPI/SubitonAPI/Controllers/PhotosController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public async Task<IActionResult> PutPhoto(int id, Photo photo)

try
{
await _context.SaveChangesAsync();
await _context.SaveChangesAsync().ConfigureAwait(true);
}
catch (DbUpdateConcurrencyException)
{
Expand All @@ -102,7 +102,7 @@ public async Task<IActionResult> PutPhoto(int id, Photo photo)
public async Task<ActionResult<Photo>> PostPhoto(Photo photo)
{
_context.Photos.Add(photo);
await _context.SaveChangesAsync();
await _context.SaveChangesAsync().ConfigureAwait(true);

return CreatedAtAction("GetPhoto", new { id = photo.Id }, photo);
}
Expand Down
4 changes: 2 additions & 2 deletions SubitonAPI/SubitonAPI/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, Seed see
if (error != null)
{
context.Response.AddApplicationError(error.Error.Message);
await context.Response.WriteAsync(error.Error.Message);
await context.Response.WriteAsync(error.Error.Message).ConfigureAwait(true);
}
});
});
Expand All @@ -98,7 +98,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, Seed see
if (error != null)
{
context.Response.AddApplicationError(error.Error.Message);
await context.Response.WriteAsync(error.Error.Message);
await context.Response.WriteAsync(error.Error.Message).ConfigureAwait(true);
}
});
});
Expand Down

0 comments on commit cc99f0b

Please sign in to comment.