I have an extremely complex object being passed to my code. I do not, at compile time (or while I am programming the code, for that matter) know what the object contains, other than a few properties, and that it is an IQueryable object...
I have to manipulate the data contained in the object by grouping on as many as 22 different datapoints (if they exist in the incoming object, and are specified in an incoming string parameter accompanying the object), aggregating the results, and returning the modified object.
The problem: LINQ (and all other C# queries) will not allow me to pass multiple datapoints to "GroupBy", no matter how I try to manipulate the expression. Our team came up with the "solution" of creating a new string field/property in the incoming object, concatenating the individual fields/properties into this single string and using the resulting string to do the grouping.
Maybe I'm "codeblind" , but I can't seem to create a new object of the same type (IQueryable) with that one extra property... any suggestions?
I have to manipulate the data contained in the object by grouping on as many as 22 different datapoints (if they exist in the incoming object, and are specified in an incoming string parameter accompanying the object), aggregating the results, and returning the modified object.
The problem: LINQ (and all other C# queries) will not allow me to pass multiple datapoints to "GroupBy", no matter how I try to manipulate the expression. Our team came up with the "solution" of creating a new string field/property in the incoming object, concatenating the individual fields/properties into this single string and using the resulting string to do the grouping.
Maybe I'm "codeblind" , but I can't seem to create a new object of the same type (IQueryable) with that one extra property... any suggestions?
Comment