It's never too late to learn!

General

If you take a look at my OFXParser code, you could think that the programming style is rather basic, indeed simplistic. And you can be right. I took the more straightforward approach, because I wanted a routine quickly. It works, but I like more elegant solutions. Lately, I found this excellent tool: LINQPad. Of course, as every .Net programmer, I had the big picture of Linq, but never tried to use it. I asked myself if I could use Linq in the case of my parser. After a short test, I found out that the answer was yes! For instance, the statement to found all the purchased stocks is that simple:

XDocument geDoc  = XDocument.Load("Test1.ofx");
var boughtStocks = from bs in geDoc.Descendants("BUYSTOCK")
select bs.Value;
1
2
3

Because I want to integrate Linq in OFXParser, the next version release will be postponed.

Trackback(0)
Comments (0)Add Comment
Write comment

busy

Sponsored Links