Pass culture as CommerceRequestContext property

Often there is a need to pass current culture from UI to the MCCF back end. 

This could be done by setting CommerceRequestContext class.

var requestContext = new CommerceRequestContext()
{
Channel = channel ?? Channel,
UserLocale = language,
UserUILocale = language,
RequestId = Guid.NewGuid().ToString()
};

Then on the backend layer (in processor or something else), we could get the passed culture as following

string culture = CommerceOperationContext.CurrentInstance.RequestContext.UserUILocale;

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.