Tagged "linq"

System.Linq.Dynamic and Spatial Searches

On my current project i am doing a LOT of dynamic searches. Lot’s of them go through System.Linq.Dynamic library - it is really just one .cs file. As library has lost somewhere on internet, the only place i have managed to find it is on one of github’s repository : I had to run some spatial searches over exposed DbGeography type - those are directly on database - via Entity Framework

LINQ Enumerable.Agregate with Path.Combine

Path.Combine accepts two parameters. Just two… So when we combine multiple path we have to deal with with nesting of Path.Combine: string rootDir = "/root/app"; string folder1 = "users"; string folder2 = "mike/upload"; string filename = "text.xml"; var path = Path.Combine(rootDir, Path.Combine(folder1, Path.Combine(folder2, filename))); There are 2 ways to handle this: 1. Use Enumerable.Agregate: string rootDir = "/root/app"; string folder1 = "users"; string folder2 = "mike/upload"; string filename = "text.xml"; var path2 = new string[] { rootDir, folder1, folder2, filename }.