Exemplo n.º 1
0
        public async Task <ActionResult <ProducentDto> > GetProducentByID(int producentID)
        {
            _orm.OpenConn();
            var producent = await _orm.GetProducentById(producentID);

            if (producent == null)
            {
                return(NotFound());
            }
            var producentDto = _mapper.Map <ProducentDto>(producent);
            await _orm.CloseConn();

            return(Ok(producentDto));
        }