-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCordisConverter.cs
57 lines (49 loc) · 1.29 KB
/
CordisConverter.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
public class CordisConverter
{
public hits hits { get; set; }
public int id { get; set; }
public string date { get; set; }
public Title title { get; set; }
}
public class hits
{
public List<hit> hit { get; set; }
}
public class hit
{
public article article { get; set; }
}
public class article
{
public string title { get; set; }
public string teaser { get; set; }
public body body { get; set; }
}
public class body
{
List <section> _section = new();
public object section
{
get => _section;
set
{
var val = (System.Text.Json.JsonElement)value;
var valk = val.ValueKind;
if (val.ValueKind == JsonValueKind.Object)
{
section sb = JsonSerializer.Deserialize<section>(val);
_section.Add(sb);
}
else
{
List<section> sbL = JsonSerializer.Deserialize<List<section>>(val);
_section.AddRange(sbL);
}
}
}
}
public class section
{
public string sectionBody { get; set; }
}
}