The project I created is Silverlight business application, Silverlight version 5, and comes with WCF Ria. Since there is no new SQL Server to be used, use entity framework as an Orm.
None of the above is difficult. Create a database table and an ADO. NET Entity model. The next step is to add a new domain service and associate it with the entity model just created.
Unfortunately, the problem is:
All available context classes are available, and a prompt says "Some Entity Framework context classes may have been excluded "!
Of course, this problem is hard for me. After Google for half a day, it finally has a result.
Cause
In vs2012, Entity Framework creates a context class based on dbcontext by default (this word is awkward). However, wcf ria does not support it.
Solution
I will translate it directly:
To solve this problem, you must convert it into an objectcontext-based model. Do the following:
1. Open your entity model in the designer (if necessary, click the blank area in the designer to ensure that no object is selected ).
2.AttributeWindow, changeCode Generation Policy, FromNoneChangeDefault.
3. Delete the two. TTFile. Assume that you have not modified these files since the entity model is created. If you have made any changes, these changes will be lost.
4. regenerate the project.
Now the problem is solved.
Why does vs2012 fail to find EF when adding a domain service?