In that in business logic layer, I have created a class like this:
public List<roleHasRight> SelectAllData()
{
try
{
return (from obj in Data.roleHasRights
join role in Data.roles on obj.FK_roleId equals role.roleId
select new
{
obj,
role.roleName
}).ToList();
}
catch
{
return null;
}
}
So what would be my return type of SelectAllData
method?
SelectAllData
did not take List<roleHasRight>
as return type it will give an error:
Cannot implicitly convert type System.Linq.IQueryable < AnonymousType#1>' to 'System.Linq.IQueryable < spaBL.roleHasRight>'