Skip to content

UoW.ExecuteAndCommitAsync does not keep culture in MVC applications #10

Description

@gravity00

The extension method ExecuteAndCommitAsync is not keeping the current culture and UI culture in ASP.NET 4.5+ applications, making it hard to use resource files properly.
Example:

public async Task<IHttpActionResult> Post(Order entity, CancellationToken ct){

    var resourceText01 = Resources.SomeResourceText;

    return await _uow.ExecuteAndCommitAsync(async () => {

        var resourceText02 = Resources.SomeResourceText;

        if(resourceText01 != resourceText02)
            throw new Exception(
                string.Format("The resource text does not match: {0} != {1}", resourceText01, resourceText02));

        await Task.Delay(3000, ct);

        return Created(entity);
    });
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions