Giter Site home page Giter Site logo

rate's Introduction

Rate

This project was created to show my skills using .NET Core to deliver the rate between a pair of currencies.

Problem

Write a .NET Core Console application that uses the contents of the XML file at https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml and expose an HTTP endpoint to retrieve the rate for a specific currency pair. So a GET request to http://localhost:port/rate?currencypair=GBPUSD should return the rate to convert GBP to USD. The rates should be cached for one hour so we don’t download the file with every request.

Installing

Clone the project

Open the solution file in Visual Studio 2017.

Set LucasRosinelli.Rate.Api as your startup project and press "IIS Express" button. The API will run on:

http://localhost:50635/

You can ignore the initial page.

To execute on browser, type on address bar:

http://localhost:50635/rate?currencyPair=GBPUSD

If you prefer, you can use Postman(https://www.getpostman.com/) to GET the rate. NOTE: cache feature will works only if "Send no-cache header" is disabled. For more information: (https://www.getpostman.com/docs/v6/postman/launching_postman/settings).

To create the executable file for Win-x64 / Windows 10 machine, go to LucasRosinelli.Rate.Presentation.Console folder in "Command Prompt" and type:

dotnet publish -c Release -r win10-x64

Command line instructions

Open the EXE and type the currency pair you want to get the rate and press ENTER. You will get the rate. If you type an invalid curreny pair (different from 6 characters or currencies that doesn't exist), you will get an error message.

To exit, type "exit" or "quit" and press ENTER.

NOTE: the API must be running.

Documentation

You will find in each files its own documentation.

Design patterns used

  • Unit of work
  • Repository pattern
  • Dependency injection

Built With

Author

rate's People

Contributors

lucasrosinelli avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.