Hello,
One possible way would be that you define a data-entity which you can fill-in in your select statement:
The entity:
public class UserEntity
{
public string Firstname { get; set; }
public string Familyname { get; set; }
public string Username { get; set; }
public string GroupName { get; set; }
public string GroupDescription { get; set; }
}
The select block:
var query = from usr in BCM.Users
join usrgrp in BCM.UsersGroups
on usr.userID equals usrgrp.userID
where usrgrp.groupID == ID
select new UserEntity {
Firstname = usr.firstName, Familyname = usr.FamilyName, Username = usr.userName,
GroupName = usrgrp.Group.groupName, GroupDescription = usrgrp.Group.groupDescription
};
Then you could return the value as:
return query.FirstOrDefault();
(This returns a strong-typed
UserEntity
object)
or
return query.ToList();
(This returns a strong-typed
List<UserEntity>
)
Another way would be that you directly convert the resulting anonymous object to a Xml or Json representation (depends on what you can use as output of your webservice) and returns the serialized string.
Hope this helps.
Best regards and happy coding,
Stops