WCF DataServices (CTP2): There is a type mismatch between the client and the service

前端 未结 5 1269
半阙折子戏
半阙折子戏 2021-01-13 17:06

I\'m using WCF Dataservices CTP2 with Entity Framework 4.1. Now then I\'m trying to get any data through my datacontext I get this exception:

System.R

5条回答
  •  孤街浪徒
    2021-01-13 17:38

    I've had a similar problem, dont know whether or not it will fix yours.

    What I had to do was to override the "CreateDataSource" method and turn off proxy creation in the svc.cs file.

    Here's the code:

        protected override DataServiceContext CreateDataSource()
        {
            var db = base.CreateDataSource();
            db.Configuration.ProxyCreationEnabled = false;
    
            return db;
        }
    

提交回复
热议问题