I have a model like this in 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; }
}
I send it to my view and mapp it to knockout js model. Then when I look the model, I see that Id, Title, Vats and SelectedCity is made observable except Factory and other object defined like it.
I searched for a long time to find the reason but i couldn't.
Does anyone have an idea about that?
Edit: viewModel before pushing to mapping is like that: