public void AddFromFile(OFXFile fileData) { var transactionList = new List <Transaction>(); foreach (var transaction in fileData.BANKMSGSRSV1.STMTTRNRS.STMTRS.BANKTRANLIST.STMTTRN) { transactionList.Add(new Transaction(transaction)); } _transactionsContext.Insert(transactionList); }
public OFXFile ReadFileToDTO(string fileLocation) { OFXFile ofxFile = null; if (File.Exists(fileLocation)) { // This path is a file var fileRead = File.ReadLines(fileLocation); ofxFile = new OFXFile(fileRead); } else { Console.WriteLine("{0} is not a valid file or directory.", fileLocation); } return(ofxFile); }