i have an SQL table with extended properties on each column.
Is there a way to access these from LINQ in c# using Linq2SQL?
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.
Things like “MS_Description” etc? Not AFAIK; you could write an SP that talks to the store at the database (taking the database object name and column name), and query that via the data-context – but nothing built in.
It would also be pretty easy to write some code that uses
Expressionto get the database names (instead of the OO names) to pass in. Something like:(or something similar; just firing up a test db…)
Where you provide the
GetPropertymethod via a mapped SPROC.Update: yes, that kinda works; example:
The
First()is a pain, but less ugly than having to have two selectors; it could be re-written that way, though:Up to you which is less hacky. Note also that you’d need to split the owner out of
tableName.