Skip to content

Instantly share code, notes, and snippets.

@m-khooryani
Created March 9, 2021 21:48
Show Gist options
  • Save m-khooryani/6c8fc61a2e448feee1f5a3a45fbafc08 to your computer and use it in GitHub Desktop.
Save m-khooryani/6c8fc61a2e448feee1f5a3a45fbafc08 to your computer and use it in GitHub Desktop.
without middleware function app
[FunctionName(nameof(SomeCommandFunction))]
public static async Task<Guid> Run([HttpTrigger(AuthorizationLevel.Anonymous, "post")]
HttpRequestData req, FunctionExecutionContext executionContext,
ILogger logger,
IUnitOfWork unitOfWork)
{
logger.LogInformation("Function started");
// some Logic (skipped for simplicity)
var addedId = Guid.NewGuid();
await unitOfWork.CommitAsync();
logger.LogInformation("Function finished");
return addedId;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment