public IHttpActionResult GetBanners([FromUri] FlutterBannerFilterModel filter)
        {
            if (String.IsNullOrEmpty(filter.page))
            {
                return(Ok <List <FlutterBannerModel> >(null));
            }

            if (filter.page == "home")
            {
                return(Ok <List <FlutterBannerModel> >(_service.getHomeBanners()));
            }

            //if (filter.page == "category")
            //    return Ok<List<FlutterBannerModel>>(_service.getCategoryBanners(filter.slug));

            //if (filter.page == "tag")
            //    return Ok<List<FlutterBannerModel>>(_service.getTagBanners(filter.slug));

            //if (filter.page == "search")
            //    return Ok<List<FlutterBannerModel>>(_service.getSearchBanners());

            //if (filter.page == "product")
            //    return Ok<List<FlutterBannerModel>>(_service.getProductBanners(filter.slug, filter.position));

            return(Ok <List <FlutterBannerModel> >(null));
        }
        public IHttpActionResult GetBanners([FromUri] FlutterBannerFilterModel filter)
        {
            if (String.IsNullOrEmpty(filter.page))
            {
                return(Ok <List <FlutterBannerModel> >(null));
            }

            var result = new List <FlutterBannerModel>();

            if (filter.page == "home")
            {
                result.AddRange(_service.getHomeBanners());
            }

            //if (filter.page == "category")
            //    result.AddRange(_service.getCategoryBanners(filter.slug));

            //if (filter.page == "tag")
            //    result.AddRange(_service.getTagBanners(filter.slug));

            if (filter.page == "search")
            {
                result.AddRange(_service.getSearchBanners());
            }

            if (filter.page == "product")
            {
                result.AddRange(_service.getProductBanners(filter.slug, filter.position));
            }

            result = result.Select(x => {
                if (x.action == FlutterPageNavigation.ViewMore)
                {
                    x.actionValue = "post/" + x.actionValue;
                }

                return(x);
            }).ToList();

            if (result.Count > 0)
            {
                return(Ok <List <FlutterBannerModel> >(result));
            }
            else
            {
                return(Ok <List <FlutterBannerModel> >(null));
            }
        }