29 lines
856 B
C#
29 lines
856 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace JinYuan.Models.HelperAttribute
|
|
{
|
|
/// <summary>
|
|
/// 数据表格列映射特性(支持字段/属性)
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
|
|
public sealed class DataGridColumnAttribute : Attribute
|
|
{
|
|
/// <summary>
|
|
/// 目标列名(默认使用成员名)
|
|
/// </summary>
|
|
public string ColumnName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 列数据类型(默认使用成员类型)
|
|
/// </summary>
|
|
public Type ColumnType { get; set; }
|
|
|
|
public DataGridColumnAttribute() { }
|
|
public DataGridColumnAttribute(string columnName) => ColumnName = columnName;
|
|
}
|
|
}
|