Giter Club home page Giter Club logo

skillsfundingagency.pds-contracts-data-api-client's Introduction

Manage your education and skills funding - Pds.Contracts.Data.Api.Client

Introduction

This is a client package used for contracts data API to provide consistent and simpler access to contracts data API. This package abstracts HttpClient calls and responses and provides a c# typed response for consumption. More information about contracts data API including details about API reference can be found at https://github.com/SkillsFundingAgency/pds-contracts-data-api

Getting Started

This is a Visual Studio 2019 project containing the implementation of abstract calls to Contracts data API. To use this package clone the project and open the solution in Visual Studio 2019 to build and package locally.

Dependencies

This package has the following dependencies.

Depended by (descendants depends on this package)

  • None

Depends on (this package depends on the following)

Usage example

To use this contracts API client SDK in your application after installation, add AddContractsDataApiClient during startup to services collection as below. It requires a Polly registry for transient fault tolerance.

    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        public void ConfigureServices(IServiceCollection services)
        {
            // Add polly registry and pass that on to the data contracts api client.
            var policyRegistry = services.AddPolicyRegistry();
            services.AddContractsDataApiClient(Configuration, policyRegistry);
        }
    }

Once added to services collection then constructor injection can be used to access an implementation instance of IDataContractService to access contract API. See the example below.

    public class ContractsDataServiceExample
    {
        private readonly IContractsDataService _contractsDataClient;

        public ContractsDataServiceExample(IContractsDataService contractsDataClient)
        {
            _contractsDataClient = contractsDataClient;
        }

        public async Task AnExampleCall()
        {
            var result = await _contractsDataClient.GetContractByContractNumberAndVersionAsync(contractNumber:"Test-1234", version:1);
            return result;
        }
    }

Build and Test

This package is built using

  • Microsoft Visual Studio 2019
  • .Net Core 3.1

To build and test locally, you can either use visual studio 2019 or VSCode or simply use dotnet CLI dotnet build and dotnet test more information on dotnet CLI can be found at https://docs.microsoft.com/en-us/dotnet/core/tools/.

Contribute

To contribute,

  • If you are part of the team then create a branch for changes and then submit your changes for review by creating a pull request.
  • If you are external to the organisation then fork this repository and make necessary changes and then submit your changes for review by creating a pull request.

skillsfundingagency.pds-contracts-data-api-client's People

Contributors

muthuramana avatar thelious1974 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.