I am developing an MVC application which I am not clear in the ideal way to save these institutions. What I am doing now is bad to say the least.
My action takes the method view modals and uses the automaker to map them to the respective organizations. My organizations are requesters, orders and orders dिāĪŠate.
Obviously all these calls are wrong with the exchange system, but instead of updating among other things, I am going on the issue of new children.
Any help how this code should look really appreciated.
Jason Mackenzie
[PHP post] Edit Public Functionality (Formulas Form Value, Requestor View Model Requester, OrderView Model Order, List & Order; OrderDetailViewModel & gt; Order Details) {Var query = r in db.Requestors where r.RequestorID == requestor.RequestorID select r; Var req = query.SingleOrDefault (); Var in OrderCity = o db.Orders, where o.RequestorID == requestor.RequestorIDO select; Var or = orderQuery.SingleOrDefault (); & Lt; OrderDetail & gt; OrDet = db.OrderDetails.Where (od = & gt; od.OrderID == or.OrderID) .Oolist (); Mapper Creativepant & lt; RequestorViewModel, Requestor & gt; (); Req = Mapper Map & lt; Requests view model, requestor & gt; (The requester); Mapper Creativepant & lt; OrderViewModel, Order & gt; (); Or = Mapper. Map & lt; OrderViewModel, Order & gt; (Order); Mapper Createmap & lt; Order dependive model, orderdicture & gt; (); OrDet = Mapper Map & lt; List & lt; Order deleteweb module & gt; list & lt; Order Doctor & gt; & Gt; (Order deletion); Foreign Currency (Order-Audit Audi in ORDet) {db.OrderDetails.ApplyCurrentValues (od); Db.SaveChanges (); } Db.Requestors.ApplyCurrentValues (req); Db.SaveChanges (); Db.Orders.ApplyCurrentValues (or); Db.SaveChanges (); See Return ("Index"); }
Firstly you can clear your questions a little bit.
var req = (Select r.RequestorID == requestor.RequestorID from DB requests. R) .SingleOrDefault (); Var or = (from db.Orders.Include ("OrderDetails") where O. RixsterID == Requestor. Select Configuration ID.) .SingleOrDefault (); Take a look at this: works to map all your related data. it's very useful.
You only have to make a call to save once.
Comments
Post a Comment