public BulkCopyRowsCopied MassiveCreate([FromBody] IEnumerable <Account> os) { #if DEBUG DataConnection.TurnTraceSwitchOn(); DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context); #endif using (var db = new peppaDB()) { var ret = db.BulkCopy <Account>(os); return(ret); } }
public IActionResult MassiveCreate([FromBody] IEnumerable <Test> os) { #if DEBUG DataConnection.TurnTraceSwitchOn(); DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context); #endif if (ModelState.IsValid) { using (var db = new peppaDB()) { var ret = db.BulkCopy <Test>(os); return(Ok(ret)); } } return(BadRequest()); }
public IActionResult MassiveCreate([FromBody] IEnumerable <Account> os) { #if DEBUG DataConnection.TurnTraceSwitchOn(); DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context); #endif if (ModelState.IsValid) { using (var db = new peppaDB()) { foreach (var o in os) { o.created_by = CurrentAccountId; o.modified_by = CurrentAccountId; } var ret = db.BulkCopy <Account>(os); return(Ok(ret)); } } return(BadRequest()); }