Recently i have faced this issue with Entity Framework . The issue occurs when dbset property refers the Mapping class instead of Entity . I fixed the issue by changes the dbset property entity type (Instead of mapping class referred Entity class).
Here are the rules
- The dbset property should have the Entity
- In model creating we should specify the mapping class
Working Example
As you see below screen shot the first one(dbset property for Contractor Visits) referred the POCO entity
and in the configuration referred the Mapping class of ContractorVisist.
Now it worked fine . Let me know if you still facing any issues ..
No comments:
Post a Comment