0
 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 Answer 1

1

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.

5
  • The workaround would be to use the MembershipProvider - or not. ... yes, I'm really me.
    – user1151
    Nov 11, 2009 at 5:42
  • 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>
    – h3n
    Nov 12, 2009 at 8:57
  • My confusion on your problem has nothing to do with the validity of my answer :)
    – user1151
    Nov 13, 2009 at 4:21
  • The membershipprovider you are talking about is far from my problem with guid.
    – h3n
    Nov 13, 2009 at 14:38
  • 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.
    – user1151
    Nov 13, 2009 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.