SettingAggregateRoot.cs
1.22 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
using JetBrains.Annotations;
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Check = Volo.Abp.Check;
namespace Yi.Framework.SettingManagement.Domain;
[SugarTable("Setting")]
public class SettingAggregateRoot : Entity<Guid>, IAggregateRoot<Guid>
{
[NotNull]
public virtual string Name { get; protected set; }
[NotNull]
public virtual string Value { get; internal set; }
[CanBeNull]
public virtual string? ProviderName { get; protected set; }
[CanBeNull]
public virtual string? ProviderKey { get; protected set; }
public SettingAggregateRoot()
{
}
public SettingAggregateRoot(
Guid id,
[NotNull] string name,
[NotNull] string value,
[CanBeNull] string providerName = null,
[CanBeNull] string providerKey = null)
{
Check.NotNull(name, nameof(name));
Check.NotNull(value, nameof(value));
Id = id;
Name = name;
Value = value;
ProviderName = providerName;
ProviderKey = providerKey;
}
public override string ToString()
{
return $"{base.ToString()}, Name = {Name}, Value = {Value}, ProviderName = {ProviderName}, ProviderKey = {ProviderKey}";
}
}