Last active
September 5, 2019 04:42
-
-
Save bruceharrison1984/1c5b5b52d2a0cb33ce9d94bbd535d331 to your computer and use it in GitHub Desktop.
Azure Functions FluentValidation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IActionResult> PostWidget( | |
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "widgets")] Models.Widget item, ILogger log) | |
{ | |
log.LogInformation($"posting widget: ${item.Id}"); | |
var newItem = await _dbContext.Widgets.AddAsync(item); | |
await _dbContext.SaveChangesAsync(); | |
return new OkObjectResult(newItem.Entity); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment