Esempio n. 1
0
 public async Task <AdaptivReconDto> GetOne()
 {
     using (var context = new AdaptivContext())
     {
         var repo    = new QueryServiceRepository <AdaptivRecon>(context);
         var service = new AdaptivReconService();
         var stats   = (await service.GetStats(repo)).ToList().FirstOrDefault();
         return(Mapper.Map <AdaptivRecon, AdaptivReconDto>(stats));
     }
 }
Esempio n. 2
0
        public async Task <IEnumerable <CommentDto> > Get()
        {
            using (var context = new AdaptivContext())
            {
                var repo     = new QueryCommentServiceRepository <MetaAdaptivReconComment>(context);
                var service  = new CommentsService();
                var comments = await service.GetComments(repo);

                return(Mapper.Map <IEnumerable <MetaAdaptivReconComment>, IEnumerable <CommentDto> >(comments));
            }
        }
Esempio n. 3
0
        public async Task <IEnumerable <AdaptivReconDto> > Get()
        {
            using (var context = new AdaptivContext())
            {
                var repo    = new QueryServiceRepository <AdaptivRecon>(context);
                var service = new AdaptivReconService();
                var stats   = await service.GetStats(repo);

                return(Mapper.Map <IEnumerable <AdaptivRecon>, IEnumerable <AdaptivReconDto> >(stats));
            }
        }
Esempio n. 4
0
 public async Task <IEnumerable <string> > GetSourceLookup()
 {
     using (var context = new AdaptivContext())
     {
         var repo    = new QueryServiceRepository <AdaptivRecon>(context);
         var service = new AdaptivReconService();
         var stats   = (await service.GetStats(repo))
                       .Select(x => x.Source).Distinct();
         return(stats);
     }
 }
Esempio n. 5
0
 public async Task <IEnumerable <AdaptivReconDto> > GetBySource(string source, DateTime date)
 {
     using (var context = new AdaptivContext())
     {
         var repo    = new QueryServiceRepository <AdaptivRecon>(context);
         var service = new AdaptivReconService();
         var stats   = (await service.GetStats(repo))
                       .Where(x => x.Source == source & x.CdsbusinessDate == date);
         return(Mapper.Map <IEnumerable <AdaptivRecon>, IEnumerable <AdaptivReconDto> >(stats));
     }
 }
Esempio n. 6
0
 public async Task <CommentDto> GetById(int id)
 {
     using (var context = new AdaptivContext())
     {
         var repo     = new QueryCommentServiceRepository <MetaAdaptivReconComment>(context);
         var service  = new CommentsService();
         var comments = (await service.GetComments(repo))
                        .Where(x => x.CommentKey == id)
                        .FirstOrDefault();
         return(Mapper.Map <MetaAdaptivReconComment, CommentDto>(comments));
     }
 }