1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| public class A
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("key")]
public string Key { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("title")]
public string Title { get; set; }
public A() {
}
public A(A a)
{
this.Id = a.Id;
this.Key = a.Key;
this.Name = a.Name;
this.Title = a.Title;
}
}
public class B: A
{
public bool Discover { get; set; }
public string Clue1 { get; set; }
public string Clue2 { get; set; }
public B() { }
public B(A a):base(a)
{
}
}
// et donc je crée une instance de ma classé B comme ça
B b=new B(a); |
Partager