jimseiwert
asked on
WCF RIA Silverlight 4 Domain Service Key Attribute
I am getting the below error when trying to add a stored procedure to my project. It is asking for a key to be defined. I have never had to do this for a stored proc. How would I go about this?
I am using Linq To Sql with WCF RIA
Error 1 The entity 'SP_Role_AreasResult' in DomainService 'Operations_DS' does not have a key defined. Entities exposed by DomainService operations must have at least one public property marked with the KeyAttribute. Operations_Client_Silverli ght
I am using Linq To Sql with WCF RIA
Error 1 The entity 'SP_Role_AreasResult' in DomainService 'Operations_DS' does not have a key defined. Entities exposed by DomainService operations must have at least one public property marked with the KeyAttribute. Operations_Client_Silverli
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Someone had this problem and found that they were referencing the wrong version of System.ComponentModel.Data Annotation s
See this forum:
http://forums.silverlight.net/forums/p/148346/370241.aspx
That being said. I will usually specify the primary key in the database or in the edmx model, and not use DomainService metadata (or very little). Are either of those an option (PK in db or Model)?
See this forum:
http://forums.silverlight.net/forums/p/148346/370241.aspx
That being said. I will usually specify the primary key in the database or in the edmx model, and not use DomainService metadata (or very little). Are either of those an option (PK in db or Model)?
ASKER
After playing with this solution (way too long) I finally got it to work using the key function
ASKER
Open in new window