コード例 #1
0
        public async Task <ActionResult <IEnumerable <API.OrderLine> > > GetAll()
        {
            try
            {
                var entities = await _orderLineRepo.GetAsync();

                return(entities.Select(item =>
                {
                    var mapEntity = _mapper.Map <API.OrderLine>(item);
                    return mapEntity;
                }).ToList());
            }
            catch (Exception ex)
            {
                return(BadRequest($"{ex.Message}"));
            }
        }