コード例 #1
0
        public virtual async Task <TDto> GetByIdAsync(int id)
        {
            var result = await DbContext.Set <TEntity>()
                         .Where(x => x.Id == id)
                         .ProjectTo <TDto>(_mapper.ConfigurationProvider)
                         .SingleAsync();

            return(result);
        }
コード例 #2
0
        public virtual async Task <TDto> HandleAsync(TRequest request)
        {
            var result = await _dbContext.Set <TEntity>()
                         .Where(x => x.Id == request.Id)
                         .ProjectTo <TDto>(_mapper.ConfigurationProvider)
                         .SingleAsync();

            return(result);
        }