I have tons of other classes that do that. But in this particular instance, WCF RIA Services start to cry (btw, I use the latest Ria.EntityFramework NuGet package). The compiler says:
Error 1 Invalid Include specification for member 'Staff.Appointments'. Non-projection includes can only be specified on members with the AssociationAttribute applied. [...] Error 2 Invalid Include specification for member 'Appointment.Staff'. Non-projection includes can only be specified on members with the AssociationAttribute applied. [...]
If I remove the [Include] on the ICollection, the error is gone (but of course, on the SL side, I don't have a Staff.Appointments attribute).
I already tried to put an [Association]-attribute on there. This fixes this particular error, but this sets a whole cascade of errors in motion where I end up putting an [Association]-attribute on
every foreign-key and a [Key]-attribute on every entity - error by error (fixing one triggers the next, ...). When I'm done with that, the generated code in Silverlight wants to compare the Id to an EntityCollection in the filter-methods ->
Where does this suddenly come from? Why doesn't it work on those two classes?