Skip to content

Commit 665d46f

Browse files
authored
refactor(IgnoreWhenExport): update AutoGenerateColumnAttribute logic (#6023)
* refactor: 增加显示实现逻辑 * test: 增加单元测试 * test: 增加单元测试 * test: 更新单元测试
1 parent 124f84b commit 665d46f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,5 +319,11 @@ public class AutoGenerateColumnAttribute : AutoGenerateBaseAttribute, ITableColu
319319
/// <summary>
320320
/// <inheritdoc/>
321321
/// </summary>
322-
public bool? IgnoreWhenExport { get; set; }
322+
public bool IgnoreWhenExport { get; set; }
323+
324+
bool? ITableColumn.IgnoreWhenExport
325+
{
326+
get => IgnoreWhenExport;
327+
set => IgnoreWhenExport = value ?? false;
328+
}
323329
}

test/UnitTest/Attributes/AutoGenerateClassTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ public void AutoGenerateColumn_Ok()
136136
attrInterface.Width = null;
137137
Assert.Equal(0, attr.Width);
138138

139+
attrInterface.IgnoreWhenExport = null;
140+
Assert.False(attrInterface.IgnoreWhenExport);
141+
139142
attrInterface.Width = -10;
140143
Assert.Equal(-10, attr.Width);
141144

0 commit comments

Comments
 (0)