4
Reply

Anonymous type error

Lokesh K

Lokesh K

Sep 29 2017 3:11 PM
189
Hi,
While returning data it throws Anonymous types error like below mention code
 
public EncounterUserDto GetUserRolesByUserId(Guid userId)
{
var userRolesList = from u in _unitOfWork.Repository<User>().GetEntityAsQuerable()
join r in _unitOfWork.Repository<Role>().GetEntityAsQuerable()
on u.RoleId equals r.RoleId
select new
{
userRoleId = u.RoleId,
userUserId = u.UserId,
roleRoleId = r.RoleId,
roleValue = r.Value
};
return userRolesList;
}
while retun it throw as anonymous types error.
 
if anyone knows pls reply 
 

Answers (4)