开发者

To many EntityCollections in Entity raise "implement IConvertible" exception in RIA Services

开发者 https://www.devze.com 2023-01-30 08:30 出处:网络
I have a Entity object create with the Entity Framework and used in Silverlight with the RIA Services framework.

I have a Entity object create with the Entity Framework and used in Silverlight with the RIA Services framework.

The Entity in question has two EntityCollections which are included in the IQueriable sent to the client.

The Entity looks like this:

public class Ad:Entity
{
     [Include]
     public EntityCollection<PublishingDates> PublishingDates {get;set;}

     [Include]
     public EntityCollection<Notice> Notice {get;set;}
}

The domain service method includes both collection using Includ开发者_开发百科e as this:

 [Query]
 public IQueryable<Ad> GetAds()
 {
      return this.ObjectContext.Ad.Include("PublishingDates").Include("Notice");
 }

On the client side when the service is called and the result returned the following exception was raise : "The object must implement IConvertible".

If only one EntityCollection is included everything works fine. If both, the previously mentioned exception is raise.

[EDIT]

I use MySQL with MySQL Net Connector version 6.3.5. as the database.


I think its a bug in Net Connector, a very similar bug was reported here http://bugs.mysql.com/bug.php?id=55349

EDIT:

Im not sure this applies to your specific case but for me the latest community server (5.5.9) works a lot better. Note that this is the db not .net connector, which seems not to be involved in the errors I got.


I have the same problem now. The interesting thing is my query works excellent with linux-driven Mysql instance but doesn't work on Windows. May be you will succeed moving to Linux

0

精彩评论

暂无评论...
验证码 换一张
取 消