示例#1
0
        /// <summary>
        /// Get Unit list
        /// </summary>
        /// <param name="paginationFilter"></param>
        /// <returns></returns>
        public async Task <List <UnitRequest> > GetUnitsAsync(PaginationFilter paginationFilter)
        {
            var data = await _repository.GetUnitsAsync(paginationFilter);

            return(data.Select(x => new UnitRequest
            {
                Id = x.Id,
                UnitName = x.UnitName
            }).ToList());

            //return _mapper.Map<List<UnitRequest>>(data);
        }
示例#2
0
        public async Task <IActionResult> Get()
        {
            var units = await _db.GetUnitsAsync();

            return(Ok(units));
        }