We have an IEnumerable Objects in C# that we want to import into the Wolfram Financial Platform. In the current C# API, we use LINQ queries to select from the Objects the specific Object that we need. In Wolfram Financial Platform we can import the IEnumerable Objects through NET/Link (More info: http://reference.wolfram.com/language/NETLink/tutorial/Overview.html)
Once the object is imported, there does not seem to be a way to use LINQ queries even after importing the LINQ library. Additionally, lambda expressions used in the LINQ queries do not have a clear replacement in Wolfram Financial Platform.
Object.Where(x => x.Property == Target).FirstOrDefault();
???[# == #.Property &, Object]`FirstOrDefault;
Current Attempt + Error
Option call = optionChain.Options .Where(x => (x.Expiration - DateTime.Today).TotalDays > 7 && (x.Expiration - DateTime.Today).TotalDays < 45 && x.PutCall == PutCall.Call && x.Class.Settlement == null) .OrderBy(x => Math.Abs(msft.Trade.Last - x.Strike)).FirstOrDefault();
Wolfram (baby steps version)
call = optionChain@Options`FirstOrDefault;
"No public instance method named "FirstOrDefault" exists for the .NET type "Core.Data.MarketData.OptionChain".
Also tried using First[optionChain@Options]; and got the non-atomic error. Found that could mean an infinite loop or non-existent variable. Checked that optionChain@Options exists by outputting it through NETConsole, which makes me think that NETObjects won't work with First (?)
Import specific values from a C# API with LINQ queries, or equivalent, intact into Wolfram Financial Platform for the purpose of writing a program in the Wolfram Financial Platform language (not allowed to do it the other way around, as much as I want to).
Originally posted this on StackExchange, but it looks like it is pending removal due to being "off-topic"