Example #1
0
        public async Task <int> StoreSubmision(SubmisionDto submision)
        {
            using (var ctx = _contextFactory.ConstructContext())
            {
                await ctx.Submisions.AddAsync(submision.ToEntity());

                return(await ctx.SaveChangesAsync(true));
            }
        }
Example #2
0
        public async Task <IEnumerable <StateDto> > GetStates()
        {
            using (var ctx = _contextFactory.ConstructContext())
            {
                var ents = await ctx.States.ToListAsync();

                return(ents.Select(e => e.ToDto()));
            }
        }
        public async Task LogException(ExceptionLogDto dto)
        {
            using (var ctx = _contextFactory.ConstructContext())
            {
                var ent = dto.ToEntity();
                await ctx.AddAsync(ent);

                await ctx.SaveChangesAsync(true);
            }
        }
        public async Task <ExportRequestDto> QueueRequest(ExportRequestDto request)
        {
            using (var ctx = _contextFactory.ConstructContext())
            {
                var ent = await ctx.ExportQueue.AddAsync(request.ToEntity());

                await ctx.SaveChangesAsync(true);

                return(ent.Entity.ToDto());
            }
        }