Advertisement
Guest User

Untitled

a guest
May 30th, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using Newtonsoft.Json;
  4.  
  5. namespace MatchingClientsCsharpImplementation
  6. {
  7.     public class Client
  8.     {
  9.         [JsonProperty("first_name")]
  10.         public String FirstName;
  11.         [JsonProperty("last_name")]
  12.         public String LastName;
  13.         [JsonProperty("phone_number")]
  14.         public String PhoneNumber;
  15.         [JsonProperty("street")]
  16.         public String Street;
  17.         [JsonProperty("house_number")]
  18.         public String HouseNumber;
  19.         [JsonProperty("postcode")]
  20.         public String Postcode;
  21.         [JsonProperty("client_id")]
  22.         public String ClientId;
  23.         [JsonProperty("city")]
  24.         public String City;
  25.         [JsonProperty("other_ids")]
  26.         public List<String> OtherIds;
  27.  
  28.         Client(String firstName, String lastName, String phoneNumber, String street, String houseNumber, String postcode, String city, String clientId) {
  29.             this.FirstName = firstName;
  30.             this.LastName = lastName;
  31.             this.PhoneNumber = phoneNumber;
  32.             this.Street = street;
  33.             this.HouseNumber = houseNumber;
  34.             this.Postcode = postcode;
  35.             this.ClientId = clientId;
  36.             this.City = city;
  37.             this.OtherIds = new List<String>();
  38.         }
  39.        
  40.         [JsonConstructor]
  41.         Client(String first_name, String last_name, String phone_number, String street, String house_number, String postcode, String city, String client_id, List<String> other_ids) {
  42.             this.FirstName = first_name;
  43.             this.LastName = last_name;
  44.             this.PhoneNumber = phone_number;
  45.             this.Street = street;
  46.             this.HouseNumber = house_number;
  47.             this.Postcode = postcode;
  48.             this.ClientId = client_id;
  49.             this.City = city;
  50.             this.OtherIds = other_ids;
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement