public IActionResult Get() { try { DataAccessSuppliers suppliersDALDC = new DataAccessSuppliers(); List <Suppliers> suppliers = suppliersDALDC.GetSuppliersAsGenericList(); return(Ok(suppliers)); } catch (Exception ex) { return(BadRequest(ex)); } }
public IActionResult GetByName(string company_name) { try { DataAccessSuppliers suppliersDALDC = new DataAccessSuppliers(); var suppliers = suppliersDALDC.GetSuppliersAsGenericList().Where(x => x.Company_Name == company_name).ToList(); if (suppliers.Count() == 0) { return(NotFound()); } return(Ok(suppliers)); } catch (Exception ex) { return(BadRequest(ex)); } }