public List <McaResult> GetAll()
 {
     using (var ctx = new VtsContext(_contextConnection.VtsConnectionString))
     {
         List <McaResult> doc = CtxSetup(ctx.McaResults).ToList();
         return(doc.ToList());
     }
 }
 public void Save(McaResult result)
 {
     using (var ctx = new VtsContext(_contextConnection.VtsConnectionString))
     {
         ctx.UpdateGraph(result, map => map.OwnedCollection(n => n.LineItems));
         ctx.SaveChanges();
     }
 }
        public McaResult GetByPollingCentre(PollingCentreRef pollingCentre)
        {
            using (var ctx = new VtsContext(_contextConnection.VtsConnectionString))
            {
                McaResult results = CtxSetup(ctx.McaResults)
                                    .FirstOrDefault(n => n.PollingCentre.Id == pollingCentre.Id);

                return(results);
            }
        }
        public McaResult GetById(Guid id)
        {
            using (var ctx = new VtsContext(_contextConnection.VtsConnectionString))
            {
                McaResult results = CtxSetup(ctx.McaResults)
                                    .FirstOrDefault(n => n.Id == id);

                return(results);
            }
        }
        protected VtsContext GetVtsContext(string info)
        {
            var ctx = new VtsContext(ConnectionString);

            return(ctx);
        }