2023-04-07 22:10:35 +08:00
|
|
|
using Demo.Features;
|
|
|
|
|
|
|
|
namespace Demo.Models;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 元数据
|
|
|
|
/// </summary>
|
|
|
|
public interface IMetadata
|
|
|
|
{
|
2023-04-08 08:35:57 +08:00
|
|
|
string Name { get; }
|
|
|
|
|
2023-04-09 16:22:54 +08:00
|
|
|
string SignId { get; }
|
2023-04-07 22:10:35 +08:00
|
|
|
/// <summary>
|
|
|
|
/// 属性
|
|
|
|
/// </summary>
|
|
|
|
MetadataPropertySet Properties { get; }
|
2023-04-08 08:35:57 +08:00
|
|
|
|
|
|
|
public IMetadata SetProperty(string name, object? value)
|
|
|
|
{
|
|
|
|
Properties.SetValue(name, value);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public TValue? GetProperty<TValue>(string name)
|
|
|
|
{
|
|
|
|
return Properties.GetValue(name).Cast<TValue>();
|
|
|
|
}
|
2023-04-07 22:10:35 +08:00
|
|
|
}
|