Skip to content

apbit/Test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Test

CountryCodepp.

This application has the following values hardcoded:

        allCountries.Add(new Country
        {
            CountryCode = 1,
            CountryName = "USA",
            CurrencyName = "Dollar"
        });
        allCountries.Add(new Country
        {
            CountryCode = 52,
            CountryName = "Mexico",
            CurrencyName = "Peso"
        });
        allCountries.Add(new Country
        {
            CountryCode = 39,
            CountryName = "Italy",
            CurrencyName = "Euro"
        });
        allCountries.Add(new Country
        {
            CountryCode = 44,
            CountryName = "Great Britain",
            CurrencyName = "Pound"
        });

When consuming this Web API service, use a phone number of 10 digits that is prefixed with any of the codes from the allCountries list. Do not use special characters in the phone field, only numbers are accepted.

To consume this service, the following route was added:

          config.Routes.MapHttpRoute(
            name: "CountryPhone",
            routeTemplate: "api/{controller}/{action}/{phonenumber}"
        );

Exchange Rate App

To consume this Web API service, the following route was added:

        config.Routes.MapHttpRoute(
           name: "ExchangeCurrency",
           routeTemplate: "api/{controller}/{action}/{source}/{target}/{amount}"              
       );

The source and target countries are hardcoded to accept the following values: "USA", "Mexico", "Great Britain", "Canada", "EU" and "China".

The amount could be any decimal amount. A new model, called "CountryRateResult" is returned by the service.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published