Code Monkey home page Code Monkey logo

hact.dtos's Introduction

HACT.Dtos

Housing Association Charitable Trust (HACT) have published a data standard for housing data interactions. This repo publishes a nuget which includes a C# implementation of the standard, allowing .NET applications to adhere to the HACT standard.

Data Transfer Object (DTO) is an object that carries data between processes in order to reduce the number of methods calls. For more information, see Data Transfer Object

Getting started

The nuget is being hosted by github packages.

To consume the package in your project, first check if you have London Borough of Hackney GitHub set up as a nuget source. To do this run the following on you're terminal:

dotnet nuget list source 

Check that you have the following set as one of your registered sources:

 1. github [Enabled]
 https://nuget.pkg.github.com/LBHackney-IT/index.json

If it s not in your list of registered sources, you will need to generate a GitHub api token:

  1. Navigate to https://github.com/settings/tokens/new
  2. Fill the note section accordingly
  3. Check the repo and read:packages checkboxes
  4. Click generate token
  5. Copy the token onto your clipboard (keep a note of this before you navigate off the page)

Replace USERNAME with your GitHub username and PASSWORD with the token on your clipboard and run the following in the terminal:

dotnet nuget add source --username USERNAME --password PASSWORD --store-password-in-clear-text --name github "https://nuget.pkg.github.com/LBHackney-IT/index.json"

Check that you have now added GitHub as a nuget source (see beginning of guide).

To add the package, replace PROJECT with the path to the project the nuget will be installed to and run:

dotnet add PROJECT package Hackney.HACT.Dtos

Discrepencies between use case definitions and data model

The use case JSON definitions consumed by the HACT.Generator project do not provide complete definition of the HACT entities. The full data model can be viewed here. Due to the incompleteness of entity definitions within the use cases, if a need arises to make a generated DTO more (not necessarily completely) reflective of the full definition, then follow these steps:

  • Create a partial class definition with the same name as the entity. The HACT.Generator produces partial classes, which this new class would be combined with.
  • Ensure the namespace of the new partial class is HACT.Dtos, which is the default namespace of all classes the HACT.Generator produces.
  • Add required additions within this class definition.

An example of this is PropertyAddress, where the use case JSON does not define an Reference property that is defined in the data model.

The following is the partial class needed to add the Reference property to PropertyAddress:

namespace HACT.Dtos
{
    public partial class PropertyAddress
    {
        public Reference Reference { get; set; }
    }
}

hact.dtos's People

Contributors

maysakanoni avatar bhavesh-patel avatar jamiejordanmt avatar

Watchers

James Cloos 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.