I am using EntityFramework Code First 5 and I have my data model.
Example:
[Table("Contract"]]
public class Contract
{
...
[ForeignKey("SomeKey")]
//[Include]
public virtual BusinessPartner BP
{
...
}
}
The data model is currently used by WPF client and it works great. Now I am writing a Silverlight client and using the same model. To acces the database I am using RIA Services. It worked great in silverlight until I had to add some RIA annotations like [Include] (it is commented in the above example).
The problem is that we are using .NET 4 Client Profile in our data model and we cannot change it. But RIA annotations are in System.ServiceModel.DomainServices.Server namespace which requires .NET 4 or .NET 4.5.
So if I add RIA [Include] annotation the model does not compile anymore.
Is there any way to use RIA annotation attributes witihin .NET 4 Client Profile so I could use the same data model in WPF and Silverlight client?
I have read something about defining those RIA attributes in XML file but I cannot find an example..
Thank you
[Include]and other attributes quite easily to allow it to compile on either platform. If you use the same namespaces as Microsoft for your attribute classes even the using statements will be identical. - Gone Coding