We have a Silverlight solution that is using t4 templates to generate our models on the server side. During this generation we are adding attributes to some of the properties. Usually these are the navigation properties, but not always. The attributes are available on both the client and server side by the use of *.Shared.cs.
These attributes are required both server side and client side. Is there a way to get the code generation on the client to generate these additional attributes when generating the related property?
If you already use the T4 template, you could look into creating your own entitygenerator derived from CSharpClientCodeGenerator.
If I remember correctly there is a method returning which attributes to generate as well methods
</br>that are invoked when starting to generate a property.
You can hopefully be able to find them using visual studios intellisense,
</br>just start typing override so you get a list of methods to override.
I think it might be GenerateAttributes is used to write the attributes.
</br>You might also need to override GenerateProperty if you need to know which property you are currently generating attributes for,
</br> just save it in a member variable, call the base implementation and then restore the member variable.
Most of the interesting code details for the build in CSharpEntityGeneratoris probably found in https://openriaservices.codeplex.com/SourceControl/latest#OpenRiaServices.DomainServices.Tools.TextTemplate/Framework/CSharpGenerators/CSharpEntityGenerator.partial.cs
Please let me know if you require further assistance.