我试图为子模型中的项目分配值,但似乎无法做到这一点。
var model = new WOLFormViewModel
{
LastS= 0,
Start = sitecustomattributes.Start,
End = sitecustomattributes.End,
PrimeSel = false,
ADFSel = false,
SupplementarySel = false,
BondSel = false,
SheetNo = 0,
EntryOneModel.Code = 1234
};
EntryOneModel是WOLFormViewModel中的公共类。
有谁知道为什么我无法将数据分配给EntryOneModel.Code = 1234?
答案 0 :(得分:0)
var model = new WOLFormViewModel
{
LastS= 0,
Start = sitecustomattributes.Start,
End = sitecustomattributes.End,
PrimeSel = false,
ADFSel = false,
SupplementarySel = false,
BondSel = false,
SheetNo = 0,
EntryOne = new EntryOneModel() { Code = 1234 )
};