Ejemplo n.º 1
0
        // GET: api/Brand
        // Brings all brands
        // SOAP Name = FetchAllBrands
        public IHttpActionResult Get()
        {
            var content = new Response <Brand>();

            try
            {
                using (var brandBusiness = new BrandBusiness())
                {
                    content = brandBusiness.FetchAllBrands();
                }
            } catch (Exception ex)
            {
                content.isSuccess = false;
                content.Message  += ex.Message;
            }
            return(new StandartResult <Brand>(content, Request));
        }
        public Response <Brand> FetchAllBrands()
        {
            Response <Brand> res = new Response <Brand>();

            try
            {
                using (var brandBusiness = new BrandBusiness())
                {
                    res = brandBusiness.FetchAllBrands();
                }
            }
            catch (Exception ex)
            {
                res.Message   = "An error occured in FetchAllBrands() func. in Spice-Websevice.BrandService\n" + ex.Message;
                res.isSuccess = false;
            }
            return(res);
        }