public IHttpActionResult Import(Sage50ImportDetails importDetails) { dataDirectoryStorage.AddLocation(importDetails.DataDirectory); using (var connection = connectionFactory.OpenConnection(importDetails)) { var transactions = transactionGetter.GetTransactions(connection, importDetails.IncludeArchived); session.ImportData(new SearcherFactory(Enumerable.Empty <SearchAction>(), displayFieldProvider.AllFields.ToArray()), transactions); } return(Ok()); }
public static void ImportFromSage50(this IContainer lifetime, Sage50ImportDetails importDetails) { var sage50Controller = lifetime.Resolve <Sage50SessionController>(); sage50Controller.Import(importDetails); }