예제 #1
0
        public ActionResult ExportJson(string products)
        {
            var factory  = new FactoryExporter <JsonExporter>();
            var exporter = factory.CreateExporter();

            exporter.Export(products);
            return(RedirectToAction("ListOfProducts"));
        }
예제 #2
0
        public ActionResult ExportCsv()
        {
            var allProducts = _productService.GetAll().ToList();
            var factory     = new FactoryExporter <CsvExporter>();
            var exporter    = factory.CreateExporter();

            exporter.Export(allProducts);
            return(RedirectToAction("ListOfProducts"));
        }