views:

112

answers:

1
 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

+1  A: 

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.

Rob Conery
so whats the workaround here?
Fleents
are you really rob conery... regard http://anirudhagupta.blogspot.com
The workaround would be to use the MembershipProvider - or not. ... yes, I'm really me.
Rob Conery
dont be confused with the sample tables. my issue here is about the joining of two tables using 2 parameters in which one of the parameter is a Guid.<code>var Test = from r in db.Table1 join p in db.Table2 on new { r.aGuidColumn, r.intColumn} equals new { p.aGuidColumn, p.intColumn} select r;</code>
Fleents
My confusion on your problem has nothing to do with the validity of my answer :)
Rob Conery
The membershipprovider you are talking about is far from my problem with guid.
Fleents
The membershipprovider is the *exact* issue here. You need to supply values to the constructor in your projections - you can't do that with the code you've written.
Rob Conery