public BaseResponse <List <Product> > GetByName() { BaseResponse <List <Product> > response = null; try { string name = (string)Request.Query["search"] ?? ""; List <Product> products = businessLogicLayer.FindProductsByName(name); response = new BaseResponse <List <Product> >(products); } catch (Exception ex) { response = new BaseResponse <List <Product> > { Error = ex.Message }; } return(response); }