English 中文(简体)
Subsonic Linq guid problem
原标题:
 The construtor  Void .ctor(System.Guid, Int32)  is not supported.

this error occured with the following statements:

var Test = from r in db.UserRoles
  join p in db.UserPermissions
    on new { r.userId, r.roleId} equals new { p.userId, p.roleId }
  select r;

userId is a guid roleId is an integer

问题回答

Right - the constructor for UserRoles looks like it needs a Guid and int - something you re not supplying explicitly. SubSonic has no way of figuring this out for you - one of the many reasons I keep telling people to abstract the membership stuff behind an interface and don t try to use SubSonic to get to it - you re circumventing most of their magic.





相关问题
Problem getting GUID string value in Linq-To-Entity query

I am trying to write a GUID value to a string in a linq select. The code can be seen below (where c.ID is GUID), but I get the following error: Unable to cast the type System.Guid to type System....

Sequential Guid Generator

Is there any way to get the functionality of the Sql Server 2005+ Sequential Guid generator without inserting records to read it back on round trip or invoking a native win dll call? I saw someone ...

.NET: Blog post on GUID?

I once read a blog post by a dev at Microsoft about the anatomy--what individual pieces of data are combined--of a System.Guid. Does anyone have the link? I m not finding it by googling.

Simple proof that GUID is not unique [closed]

I d like to prove that a GUID is not unique in a simple test program. I expected the following code to run for hours, but it s not working. How can I make it work? BigInteger begin = new BigInteger((...

Subsonic Linq guid problem

The construtor Void .ctor(System.Guid, Int32) is not supported. this error occured with the following statements: var Test = from r in db.UserRoles join p in db.UserPermissions on new { r....

热门标签