I am getting an error when trying to convert my linq query to a list like I would normally do.
Here is my query:
var Services = (from sa in _ctx.ServiceAttrs
join pp in _ctx.ProcessorProducts
on new { ServiceId = sa.ServiceID, PrsnPk = ActivePrsnPk } equals
new { ServiceId = pp.ServiceID, PrsnPk = pp.PrsnPK } into tmp
from PersonServices in tmp.DefaultIfEmpty()
.Select(PersonServices => new ReviewerServiceDto()
{
ServiceId = sa.ServiceID,
ServiceAliasDescription = sa.ServiceAlias,
IsSelected = (PersonServices.IsActivated == null)
? false
: true,
}).OrderBy(dto => dto.ServiceAliasDescription).ToList();
I am getting redlined right at the ToList(). Tells me parenthesis can be removed, however when I remove them, it will no longer evoke the method to convert to list...
I thought I was missing a bracket somewhere but It looks good to me.
IsSelected = (PersonServices.IsActivated == null) ? false : trueis equivalent to simplyIsSelected = PersonServices.IsActivated != null.