ChipDemo/Core/Models/IMetadata.cs

28 lines
535 B
C#

using Demo.Features;
namespace Demo.Models;
/// <summary>
/// 元数据
/// </summary>
public interface IMetadata
{
string Name { get; }
string SignId { get; }
/// <summary>
/// 属性
/// </summary>
MetadataPropertySet Properties { get; }
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>();
}
}