예제 #1
0
    protected async Task CommandAsync(Func <Task> authorize, Func <Task> exec)
    {
        try
        {
            using var uow = _unitOfWorkProvider.Begin();

            await authorize();
            await exec();

            await uow.CommitAsync();
        }
        catch (Exception exc)
        {
            Handle(exc);
            throw;
        }
    }