Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following country codes are TRS countries:
AT, BE, BG, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GR, HR, HU, IE, IS, IT, LI, LT, LU, LV, MT, NL, NO, PL, PT, RO, SE, SI, SK
We also introduced the country code XX to represent all other countries.


Code Block
languagec#
themeRDark
titleC# - Get all TRS countries from a BFS instance
linenumberstrue
collapsetrue
 //Use the GetTRSCountries method to get all TRS-countries in the BFS instance and write
//the BrickId's and country codes in the console
var client = new BFSServiceReference.bfsapiSoapClient();
var credentials = new BFSServiceReference.Credentials()
{
    UserName = bfsusername, //Username of administrative user in your instance of BFS
    Password = bfspassword, //Password of the administrative user in your instance of BFS
};
var trsCountries = client.GetTRSCountries(new BFSServiceReference.GetTRSCountriesRequest()
{
    Credentials = credentials,
    identify = bfsidentifier, //Identifier is a unique token for your instance of BFS
    
    Fields = new BFSServiceReference.GetTRSCountriesFields()
    {
        BrickId = true,
        CountryCode = true,
        TRSIdTypePrio1 = true,
        TRSIdTypePrio2 = true,
        TRSIdTypePrio3 = true
    },
});
foreach (var c in trsCountries.Result)
{
    Console.WriteLine(c.BrickId + "," + c.CountryCode);
}

...