I think I'm doing almost this work, but I can not understand how it will end.
Model: See model Controller: line You are very close! Or: Because you already have a listing on your model, instead of using Public Square Location {Public Ink Placement Command {Receive; Set; } Public String SiteCode {get; Set; } Public Int Insurance (Received; Set; } Public Inc IncidentId {get; Set; }}
public list & lt; Location & gt; {Get Listings; Set; }
[httpPOST] Public ActionStrust Adrecord (RecordView Model Model) {if (ModelState.IsValid) {location location; Foreign language (local place in the model) list {location = new location {PersonId = model.PersonId, SiteCode = loc.SiteCode, IncidentId = loc.IncidentId}; } {Var db = new MyEntities ()) using {db.Order.AddObject (event); Db.Location.AddObject (location); Db.Comment.AddObject (comment); Db.SaveChanges (); }
db.Location.AddObject (location); Getting blank. How do I get a listing from foreach, db?
// Create a new list of your unit location (namespace data may not contain) var location list = new list & lt; Data Location & gt; (); Foreign language (List in model location) (var location = new data. Location {PersonId = model.PersonId, SiteCode = loc.SiteCode, IncidentId = loc.IncidentId}; locationList.Add (location);} (var db = New MyEntities {Db.Order.AddObject (event); Foreign language (various items in the space object) {db.Location.AddObject (location);} Db.Comment.AddObject (comment); db.SaveChanges () );}
(var db = new MyEntities () ) {Db. Order.AddObject (event); Foreign language (in model location ) (Var location = new data. Location {PersonId = model.PersonId, SiteCode = loc.SiteCode, IncidentId = loc.IncidentId}; db.Location.AddObject (location);} Db.Comment.AddObject (comment); db SaveChanges ();}
No comments:
Post a Comment