I have a method that takes an IQueryable. Is there a LINQ query that will give me back the size of each column in the IQueryable?
To be more clear: this is Linq-to-objects. I want to get the length of the ToString() of each ‘column’.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends. If you mean is there a completely generic way to make this determination the answer is no. All IQueryable will give access to is the Type of each expression. There is no way to arbitrarily map a Type to a column size.
If on the other hand you have the ability to map a Type to members and member type to a column size then yes there is a way to get the size.