Example #1
0
        public IHttpActionResult Get(int id)
        {
            var supplier = suppliersService.GetSupplierById(id);

            if (supplier == null)
            {
                return(NotFound());
            }

            var supplierView = mapper.Map <SupplierDTO, SupplierView>(supplier);

            return(Ok(supplierView));
        }
        public HttpResponseMessage GetSupplierById(int id)
        {
            var supplier = _service.GetSupplierById(id);

            return(Request.CreateResponse(HttpStatusCode.OK, supplier));
        }
Example #3
0
 /// <summary>
 /// Повертає екземпляр постачальника за ідентифікатором
 /// </summary>
 /// <param name="id">Ідентифікатор постачальника</param>
 /// <returns>Екземпляр постачальника</returns>
 public SuppliersDtoModel GetSupplierById(int id) => suppliersService.GetSupplierById(id);