using System.Collections.Generic;
public static void Main()
Console.WriteLine("-" + VatMoss.GetVatPercentage("be", "be", true));
Console.WriteLine("-" + VatMoss.GetVatPercentage("be", "uk", true));
Console.WriteLine("-" + VatMoss.GetVatPercentage("be", "uk", false));
Console.WriteLine("-" + VatMoss.GetVatPercentage("uk", "uk", false));
Console.WriteLine("-" + VatMoss.GetVatPercentage("be", "be", false));
Console.WriteLine("-" + VatMoss.GetVatPercentage("be", "us", false));
Console.WriteLine("-" + VatMoss.GetVatPercentage("be", "us", true));
public static class VatMoss
public static decimal? GetVatPercentage(string clientIsoCountry, bool isVatClient)
return GetVatPercentage("be", clientIsoCountry, isVatClient);
public static decimal? GetVatPercentage(string sellerIsoCountry, string clientIsoCountry, bool isVatClient)
if (!vatRates.ContainsKey(clientIsoCountry.ToUpperInvariant()))
if (sellerIsoCountry.ToUpperInvariant() == clientIsoCountry.ToUpperInvariant())
return vatRates[sellerIsoCountry.ToUpperInvariant()];
return vatRates[clientIsoCountry.ToUpperInvariant()];
private static readonly Dictionary<string, decimal> vatRates = new Dictionary<string, decimal>{