public void SaveBatch(Batch batch, EntityState entityState) { using var batchContext = new BatchContext(); batchContext.Entry(batch).State = entityState; _logger.LogDebug("Start SaveBatch..."); int x = (batchContext.SaveChanges()); _logger.LogDebug("Finished SaveBatch..."); }
public Batch GetBatches(int batchId, int groupId) { Batch batch = null; using (var batchContext = new BatchContext()) { var x = batchContext.Batches; batch = batchContext.Batches.Where(batc => batc.BatchId.Equals(batchId) && batc.GroupId.Equals(groupId)).FirstOrDefault(); _logger.LogDebug("Finished Getting Batch..."); } return(batch); }