-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathVinylRecordModel.cs
More file actions
106 lines (87 loc) · 3.58 KB
/
Copy pathVinylRecordModel.cs
File metadata and controls
106 lines (87 loc) · 3.58 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace AutoMapper.OData.EFCore.Tests.AirVinylModel
{
public class VinylRecordModel
{
[Key]
public int VinylRecordId { get; set; }
[StringLength(150)]
[Required]
public string Title { get; set; }
[StringLength(150)]
[Required]
public string Artist { get; set; }
[StringLength(50)]
public string CatalogNumber { get; set; }
public int? Year { get; set; }
public PressingDetailModel PressingDetail { get; set; }
public int PressingDetailId { get; set; }
public virtual PersonModel Person { get; set; }
public int PersonId { get; set; }
public ICollection<DynamicPropertyModel> DynamicVinylRecordProperties { get; set; }
= new List<DynamicPropertyModel>();
public IDictionary<string, object> Properties { get; set; }
private Dictionary<string, VinylLinkModel> _links;
public IDictionary<string, VinylLinkModel> Links {
get
{
if (_links is null)
{
_links = new Dictionary<string, VinylLinkModel>()
{
{ "buyingLink", new VinylLinkModel { Href = $"http://test/buy/{VinylRecordId}" } },
{ "reviewLink", new VinylLinkModel { Href = $"http://test/review/{VinylRecordId}" } }
};
}
return _links;
}
}
private Dictionary<string, VinylLinkModel> _moreLinks;
public Dictionary<string, VinylLinkModel> MoreLinks
{
get
{
if (_moreLinks is null)
{
_moreLinks = new Dictionary<string, VinylLinkModel>()
{
{ "buyingLink", new VinylLinkModel { Href = $"http://test/buy/{VinylRecordId}" } },
{ "reviewLink", new VinylLinkModel { Href = $"http://test/review/{VinylRecordId}" } }
};
}
return _moreLinks;
}
}
private SortedDictionary<string, VinylLinkModel> _extraLinks;
public SortedDictionary<string, VinylLinkModel> ExtraLinks
{
get
{
if (_extraLinks is null)
{
_extraLinks = new SortedDictionary<string, VinylLinkModel>()
{
{ "buyingLink", new VinylLinkModel { Href = $"http://test/buy/{VinylRecordId}" } },
{ "reviewLink", new VinylLinkModel { Href = $"http://test/review/{VinylRecordId}" } }
};
}
return _extraLinks;
}
}
private System.Collections.Concurrent.ConcurrentDictionary<string, VinylLinkModel> _additionalLinks;
public System.Collections.Concurrent.ConcurrentDictionary<string, VinylLinkModel> AdditionalLinks
{
get
{
if (_additionalLinks is null)
{
_additionalLinks = new System.Collections.Concurrent.ConcurrentDictionary<string, VinylLinkModel>();
_additionalLinks.TryAdd("buyingLink", new VinylLinkModel { Href = $"http://test/buy/{VinylRecordId}" });
_additionalLinks.TryAdd("reviewLink", new VinylLinkModel { Href = $"http://test/review/{VinylRecordId}" });
}
return _additionalLinks;
}
}
}
}