2
我想在我的CSV输出中包含子类的值。子类包含几个指示可用操作的布尔值。用csvHelper序列化子类
public class AllowedActions {
public bool CanCheckIn { get; set; }
public bool CanCheckOut { get; set; }
}
public class ContentItem {
public AllowedActions Actions { get; set; }
public Guid? ContentTypeId { get; set; }
}
我可以创建一个类图,既包括ContentItem属性和AllowedAction类的价值?将它们添加到映射会导致“属性”布尔CanCheckIn'未定义为类型'XYZ.ContentItem'“错误。
这不起作用:
Map(m => m.Actions.CanCheckIn);
Map(m => m.Actions.CanCheckOut);