-
Notifications
You must be signed in to change notification settings - Fork 684
/
PackageEntity.cs
104 lines (91 loc) · 3.27 KB
/
PackageEntity.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
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
using System;
using BaGet.Core;
using Microsoft.Azure.Cosmos.Table;
namespace BaGet.Azure
{
/// <summary>
/// The Azure Table Storage entity that maps to a <see cref="Package"/>.
/// The <see cref="TableEntity.PartitionKey"/> is the <see cref="Package.Id"/> and
/// the <see cref="TableEntity.RowKey"/> is the <see cref="Package.Version"/>.
/// </summary>
public class PackageEntity : TableEntity, IDownloadCount, IListed
{
public PackageEntity()
{
}
public string Id { get; set; }
public string NormalizedVersion { get; set; }
public string OriginalVersion { get; set; }
public string Authors { get; set; }
public string Description { get; set; }
public long Downloads { get; set; }
public bool HasReadme { get; set; }
public bool IsPrerelease { get; set; }
public string Language { get; set; }
public bool Listed { get; set; }
public string MinClientVersion { get; set; }
public DateTime Published { get; set; }
public bool RequireLicenseAcceptance { get; set; }
public int SemVerLevel { get; set; }
public string Summary { get; set; }
public string Title { get; set; }
public string IconUrl { get; set; }
public string LicenseUrl { get; set; }
public string ProjectUrl { get; set; }
public string RepositoryUrl { get; set; }
public string RepositoryType { get; set; }
public string Tags { get; set; }
public string Dependencies { get; set; }
public string PackageTypes { get; set; }
public string TargetFrameworks { get; set; }
}
/// <summary>
/// A single item in <see cref="PackageEntity.Dependencies"/>.
/// </summary>
public class DependencyModel
{
public string Id { get; set; }
public string VersionRange { get; set; }
public string TargetFramework { get; set; }
}
/// <summary>
/// A single item in <see cref="PackageEntity.PackageTypes"/>.
/// </summary>
public class PackageTypeModel
{
public string Name { get; set; }
public string Version { get; set; }
}
/// <summary>
/// The Azure Table Storage entity to update the <see cref="Package.Listed"/> column.
/// The <see cref="TableEntity.PartitionKey"/> is the <see cref="Package.Id"/> and
/// the <see cref="TableEntity.RowKey"/> is the <see cref="Package.Version"/>.
/// </summary>
public class PackageListingEntity : TableEntity, IListed
{
public PackageListingEntity()
{
}
public bool Listed { get; set; }
}
/// <summary>
/// The Azure Table Storage entity to update the <see cref="Package.Downloads"/> column.
/// The <see cref="TableEntity.PartitionKey"/> is the <see cref="Package.Id"/> and
/// the <see cref="TableEntity.RowKey"/> is the <see cref="Package.Version"/>.
/// </summary>
public class PackageDownloadsEntity : TableEntity, IDownloadCount
{
public PackageDownloadsEntity()
{
}
public long Downloads { get; set; }
}
internal interface IListed
{
bool Listed { get; set; }
}
public interface IDownloadCount
{
long Downloads { get; set; }
}
}