public IActionResult GetProduct(int id) { var product = _IProductRepository.Select(id); return(Ok(ProductsDTO.generateDto(product))); //return View(ProductsDTO.generateDto(product)); }
public List <ProductsDTO> GetAllProducts() { var q = _IProductRepository.SelectAll().ToList(); List <ProductsDTO> list = new List <ProductsDTO>(); foreach (Product p in q) { list.Add(ProductsDTO.generateDto(p)); } return(list); }
public IActionResult GetProductbyName(String id) { var product = _IProductRepository.SelectByName(id); return(Ok(ProductsDTO.generateDto(product))); }