I love me some ORM!
Snippet on making an object to be populated with data and saved. You can pile in the Add() objects and then call the SaveChanges() once if you need to. Such as N sales order detail lines.
public static void loadresp(String Plant, String respStr) { using (RingSecurityEntities1 dbb = new RingSecurityEntities1()) { SafetyCultureResponse responseFrom = new SafetyCultureResponse(); Guid gu = Guid.NewGuid(); responseFrom.ID = gu; responseFrom.EventDate = DateTime.Now; responseFrom.ReponsePlant = Plant; responseFrom.ResponsePhrase = respStr; dbb.SafetyCultureResponses.Add(responseFrom); dbb.SaveChanges(); } }
On Mon, Jul 1, 2019 at 3:47 AM Alan Bourke alanpbourke@fastmail.fm wrote:
On Thu, 27 Jun 2019, at 6:25 PM, Kevin Cully wrote:
Another language command is the SCATTER NAME and GATHER NAME. The ability to create an object with properties that corresponds to each field of a record is incredibly useful
Pick any one of the many ORMs!
-- Alan Bourke alanpbourke (at) fastmail (dot) fm
[excessive quoting removed by server]