Hi im trying to assign a default group to any user that registers with my site. Since the admin Id of that group is the administrator, I query my database for a group with a admin id of my administrator and then assign that group to the user. However the following error is being thrown "Unable to cast object of type 'System.Data.Objects.ObjectQuery`1[DatabaseModel1.Group]' to type 'DatabaseModel1.Group'. " Heres the code
Dim defaultGroup = (From group As Group In context.Groups
Where group.AdminID = ((From users As User0 In context.User0
Where users.Name Like "Administrator"
Select users.UserID).First)
Select group)
currentUser.Groups.Add(defaultGroup)//the error is being thrown here
any help would be appreciated Thanks