【优化】如果 enum的item comment为空,但有alias,则comment取alias值

main
walon 2021-08-12 16:34:07 +08:00
parent d673320f2c
commit eb8279844d
1 changed files with 8 additions and 1 deletions

View File

@ -74,7 +74,14 @@ namespace Luban.Job.Common.Defs
foreach (var item in e.Items)
{
Items.Add(new Item { Name = item.Name, Alias = item.Alias, Value = item.Value, Comment = item.Comment });
Items.Add(new Item
{
Name =
item.Name,
Alias = item.Alias,
Value = item.Value,
Comment = string.IsNullOrWhiteSpace(item.Comment) ? item.Alias : item.Comment,
});
}
}