コード例 #1
0
ファイル: StatsController.cs プロジェクト: TedescaGodwin/test
 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));
     }
 }
コード例 #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));
            }
        }
コード例 #3
0
ファイル: StatsController.cs プロジェクト: TedescaGodwin/test
        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));
            }
        }
コード例 #4
0
ファイル: StatsController.cs プロジェクト: TedescaGodwin/test
 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);
     }
 }
コード例 #5
0
ファイル: StatsController.cs プロジェクト: TedescaGodwin/test
 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));
     }
 }
コード例 #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));
     }
 }