0

Asp.Net Mvc に次のようなモデルがあります。

 public class CustomerModel : BaseModel
    {
        public CustomerModel()
        {

            Vats = new List<Vat>();
            SelectedVat = new List<long>();
            AdressItems = new List<AddressModel>();
            CustomerTypes = new List<CustomerType>();
            CustomerType = new List<long>();
            Factory = new Factory();
            Company = new Company();
            Branch = new BranchModel();

            Transporter = new TransporterModel();
            Cities = new List<City>();
            SelectedCity = new List<long>();

            SelectedWareHouse = new WareHouseModel();
            WareHouses = new List<WareHouseModel>();
            SelectedAddress = new AddressModel();
            Addresses = new List<AddressModel>();

        }

        public long Id { get; set; }

        public string Title { get; set; }

        public string SignBoard { get; set; }



        public long? VatId { get; set; }

        public bool IsHasWarehouse { get; set; }
        public bool IsManifacturer { get; set; }
        public bool Valid { get; set; }

        public List<AddressModel> AdressItems { get; set; }


        public List<CustomerType> CustomerTypes { get; set; }
        public List<long> CustomerType { get; set; }

        public Factory Factory { get; set; }
        public Company Company { get; set; }

        public BranchModel Branch{ get; set; }
        public TransporterModel Transporter { get; set; }


        public List<Vat> Vats { get; set; }
        public List<long> SelectedVat { get; set; }


        public List<City> Cities { get; set; }
        public List<long> SelectedCity { get; set; }


        public List<WareHouseModel> WareHouses { get; set; }
        public WareHouseModel SelectedWareHouse { get; set; }

        public List<AddressModel> Addresses { get; set; }
        public AddressModel SelectedAddress { get; set; }

    }

ビューに送信し、ノックアウト js モデルにマップします。次に、モデルを見ると、Id、Title、Vats、および SelectedCity が、Factory とそのように定義された他のオブジェクトを除いて監視可能になっていることがわかります。

その理由を長い間探しましたが、見つかりませんでした。

誰かがそれについて考えを持っていますか?

編集:マッピングにプッシュする前のviewModelは次のようになります:

ここに画像の説明を入力

4

0 に答える 0