Very interesting. Ting's suggestion mimics the RIA Services approach ... except that, unlike RIA Services, you have to carry the metadate "buddy" class into the SL app with you.
We don't have a separate code generation tool that transforms server-side entity classes and associated metadata and shared partial classes into a Silverlight entity class. We don't have it because we don't need it and you don't want it (trust me!).
Ah ... but it would be convenient in this corner case, wouldn't it? Instead, per Ting, you can link to the metadata class in SL and use the ReflectionFns to get your attribute.
===
There is another way. You could inscribe your attribute right into the generated entity class by overriding a property generation method in our T4 code generation base class (virtually no T4 knowledge needed). An example of how to do that will follow (or you can search our forum to see how some other folks are doing this).
Now you'd be able to write "MyAttribute" into the code. Unfortunately, that's only half the battle. You need to tell your code-generation overide (a) whether or not to hang this attribute on the property and (b) what the parameter values should be. Where do you specify this information where your code-generation overide can find it?
I considered and immediately discarded the notion of a separate XML file that your code can discover an interpret. You could do this ... and write yourself a little DSL for it ... maybe even your own visual editor. But this seems like a lot of work for a small problem.
Idea #2: We enhance our DevForce VS EF Designer extension so you can inject your own properties. Then you could entere values in the EF Designer just as we do. We'll look into this for a future release; it doesn't help you now.
Idea #3: Hijack an existing EF Designer property. This is a short term hack but it may be your best bet. The "Long Description" under the "Documentation" heading would be my candidate.
Adopt your own markup convention so you can distinguish your attribute parameters from the text you'd actually like to see in the Long Description.
Your code-generation override would (a) extract your custom markup from the Long Description, (b) rewrite the Long Description text so that the XML remarks in the code turn out as they should, (c) use the markup to write your custom property.
A total hack as I said. We'll come up with something better in a future release.
Hope this helps for now.
Edited by WardBell - 10-Jun-2010 at 8:37pm