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)); } }
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)); } }
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)); } }
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); } }
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)); } }
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)); } }