4

CSV 出力に子クラスの値を含めたいです。子クラスには、使用可能なアクションを示すブール値がいくつか含まれています。

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 クラスの値の両方を含むクラス マップを作成できますか? それらをマップに追加すると、「Property 'Boolean CanCheckIn' is not defined for type 'XYZ.ContentItem'」エラーが発生します。

これは機能しません:

        Map(m => m.Actions.CanCheckIn);
        Map(m => m.Actions.CanCheckOut);
4

1 に答える 1