Ejemplo n.º 1
0
        public ActionResult ExportJson(string products)
        {
            var factory  = new FactoryExporter <JsonExporter>();
            var exporter = factory.CreateExporter();

            exporter.Export(products);
            return(RedirectToAction("ListOfProducts"));
        }
Ejemplo n.º 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"));
        }