XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEExtension.NetCore.AutoConfig

【DLL】自动实现配置文件的存储

公开
关注 0 Fork 0 Star 0
UTF-8
namespace XFEExtension.NetCore.AutoConfig;

/// <summary>
/// 将属性添加至储存列表
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class ProfilePropertyAttribute : Attribute
{
    /// <summary>
    /// 自动生成的属性名称
    /// </summary>
    public string PropertyName { get; set; } = string.Empty;
    /// <summary>
    /// 将属性添加至存储列表
    /// </summary>
    public ProfilePropertyAttribute() { }
    /// <summary>
    /// 将属性添加至存储列表,给定属性名
    /// </summary>
    /// <param name="propertyName">属性名</param>
    public ProfilePropertyAttribute(string propertyName)
    {
        PropertyName = propertyName;
    }
}