Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreserveCultureAttribute does not work #77

Closed
odinserj opened this issue Apr 16, 2014 · 0 comments
Closed

PreserveCultureAttribute does not work #77

odinserj opened this issue Apr 16, 2014 · 0 comments
Labels

Comments

@odinserj
Copy link
Member

Using HangFire.Mailer sample code. An InvalidOperationException is being thrown.

// HomeController/Create action
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("es-ES");
BackgroundJob.Enqueue(() => NotifyNewComment(model.Id));
[PreserveCulture]
public static void NotifyNewComment(int commentId)
{
    var currentCultureName = Thread.CurrentThread.CurrentCulture.Name;
    if (currentCultureName != "es-ES")
    {
        throw new InvalidOperationException(String.Format("Current culture is {0}", currentCultureName));
    }
    // ...
@odinserj odinserj added the bug label Apr 16, 2014
@odinserj odinserj assigned odinserj and unassigned odinserj May 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant