public ActionResult <ExportResult> Export(ExportLayout layout) { ExportImportService <T> tempService = new ExportImportService <T>(_context); var export = tempService.GetExportResult(layout); return(Ok(export)); }
public ActionResult Import(ExportResult importData) { ExportImportService <T> tempService = new ExportImportService <T>(_context); tempService.SetImportResult(importData); return(Ok()); }
private void InitData(string databaseName) { var optionBuilder = new DbContextOptionsBuilder() .UseInMemoryDatabase(databaseName: databaseName) .Options; _context = new TestContext(optionBuilder); var table1 = _context.Set <Table1>(); var table3Entry = new Table3() { Id = 1, Name = "Test2" }; var table2Entry = new Table2() { Name = "Test2", Id = "Abc", ThirdTableRows = new List <Table3>() { table3Entry } }; var table1Entry = new Table1() { Name = "Test", SecondTableRows = new List <Table2>() { table2Entry }, Id = Guid.Parse("542c31f0-35e3-4a7d-a939-803f18f94669") }; table1.Add(table1Entry); var table1Entry_2 = new Table1() { Name = "Test", Id = Guid.Parse("642c31f0-35e3-4a7d-a939-803f18f94669") }; table1.Add(table1Entry_2); var additionalData = _context.Set <AdditionalData>(); additionalData.Add(new AdditionalData() { Name = "TestAdditional", Id = Guid.Parse("cca5e277-77e7-4d70-9eb1-067156222da3"), }); _context.SaveChanges(); _exportService = new ExportImportService <Table1>(_context); }
public ActionResult <List <LogEntry> > Statements(ExportResult[] dataSets) { ExportImportService <T> tempService = new ExportImportService <T>(_context); return(Ok(tempService.ExportSQLScripts(dataSets[0], dataSets[1]))); }