asp.net mvc - MVC: Complex Array Model Binding Fails -


I'm stuck on this, someone can tell why the lines do not bind?

I have tried to submit JSON.stringify and with all types of combinations.

I am now running it through unit tests and it is still not binding.

  var formCollection = New Name Value Collection {{"Purchase Order [0] [Lines] [0] [Part]", "ABD 33-360-2"}, {"Purchase Order [0] [Lines] [0] [Part Details] "," Carriage Assembly (Dynamic) "}, {" Purchase Orders [0] [Lines] [0] [PartISS] "," C "}, {" Purchase Order [0] [Lines] [0] [value {"purchase orderers [0] [line] [0] [number]", "5", "560", "{0} [line] [0] [value] , [Zero]}, "purchase order [0] [line] [0] [lead time]", "0"}, {"purchase order [0] [line] [0] [unit]", "every"} , {"Purchase order [0] [narrative] [0]", "a"}, {"purchase Order "[0] [Quality orange] []", "A"}, {"Purchase order [0] [agent]", "11"}, {"purchase orders [0] [czat]", "0"}, {"Purchase Order [0] [Total VAT]", "0"}, {"Purchase Order [0] [VAT Noo]", "blank"},}; Var Value Provider = New NameValueAction Collection Provider (FormColutions, Empty); Var Metadata = ModelMatData Provider. Present. GetatrateForType (empty, typef (pre delivery)); Var Binding Contents = New ModelBladingTontact {ModelName = "", ValueProvider = valueProvider, ModelMetadata = Metadata}; Var controller console = new controller (); Var sut = new DefaultModelBinder (); // Act Pre Delivery PD = (Pre Delivery) sut.BindModel (Controller Contintbox, Binding Contintbox); Console Line (string format ("pre delivery {0}", pd! = Null)); Console.print line (string.format ("pd purchase orderers {0}", pd purchase orders! = Null)); Console.lightline (string.format ("pd purchase order [0] {0}", PD. Purchase order [0]! = Null)); Console Line (string format ("PD. Purchase order [0]. Lines {0}", PD. Purchase order [0]. Lines! = Null)); Console.light line (string.format ("pd. Purchase order [0]. Lines {0}", PD. Purchase orders [0] line quotes.tostring ()); Class - (Very heavy for this post):  
  Public category order: IORDR {public string agent {Receive; Set; } Public string buyer {get; Set; } Public string carrier {receive; Set; } Public String Contacts {get; Set; } Public string currency {received; Set; } Public string CusSupCode {get; Set; } The name of the public string client {get; Set; } Public string CusSupRef {get; Set; } Public string CusSupAddr {get; Set; } Public int iDelAddr {get; Set; } Public string DelAddr {get; Set; } Public string InvAdr {get; Set; } Public e-invoice type invoice type {get; Set; } Public listing & lt; Line & gt; Lines {Received; Set; } Public String [] Legend {Receive; Set; } Public String [] Quality Management [Receive; Set; } Public string release {get; Set; } Receive the public string field { Set; } Public class line {public string CusSupPart {get; Set; } Receive Public Decimal Discount PC; Set; } Received Public String DP { Set; } Receive Public Bull ISFOC; Set; } Public Child ISSIDLD {Received; Set; } Public string OrderRef {get; Set; } Public int OrderRefLine {get; Set; } Public Bowl PoA {Receive; Set; } Public string part {get; Set; } Public string PartDescription {get; Set; } Public String PartIss {get; Set; } Public decimal value {received; Set; } Public String [] Legend {Receive; Set; } Public Integer Number {Received; Set; } Receive public int leadtime {}; Set; } Receive public string unit { Set; } Public Date Time? ReqDate {get; Set; } Public Date Time SchdDate {get; Set; } Public Decimal UnitConv {get; Set; }} Public class HistoryEntry {public string story {receipt; Set; } Public DateTime Timestamp {get; Set; The required format for array binding is  property [0]}}}}  

property [0] [key] .

Instead, try it:

  {"Purchase order [0]. Let's [0].", "ABD 33-360-2"}, {" Purchase order [0]. LAN [0]. Part-description "," Carriage assembly (dynamic) "}, {...}  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -