In the meantime I put my code snippet as a crappy image. The problem that I had being a fairly new Linq user was, what if I want to pass the results of a LINQ query to another method, or based on some logic in an if statement, do something different for the query, how can I declare it so I can pass it or use it and assign it based on logic. I found that in the case where I know what I am getting back from my query, then I can declare an Ienumerable of my type and assign it or pass it as I please. In this case I had a query return squares in a sudoku puzzle. You can see below how to declare and then assign the results of one of two linq queries.
No comments:
Post a Comment