Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Matt Nolan 45 posts 65 karma points
    Jan 09, 2012 @ 11:25
    Matt Nolan
    0

    Alpha-2 Country code

    Hi,

    I was wondering whether there is any intention to extend the 'Country' class to include the Alpha-2 code in addition to the numeric code?

    I realise that it would be fairly trivial to implement a look up table for myself but i would be nice if it could all be kept together, this would also minimise calls to the db.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 23, 2012 @ 13:02
    Søren Spelling Lund
    0

    You should be able to get the two letter ISO code with the following code:

    string twoLetterIsoCode = new RegionInfo(country.Culture). TwoLetterISORegionName // country.Culture will hold "en-us", "en-gb", "da-dk", etc.

    If you want to get fancy with it you can do an extension method with the code in it so you can call TwoLetterIsoCode directly in the country object.

Please Sign in or register to post replies

Write your reply to:

Draft