I'm trying to get the objects from a IQueryable that have some properties equal to the objects from another List.
The query is:
var notificationDataWithoutSettingsTypeTwo =
(from nd in notificationsData
join tnAc in taskAndNotificationAllCustomersModel on new { nd.TaskId, nd.NotificationType } equals new { tnAc.TaskId, tnAc.NotificationType }
select nd);
notificationData is the IQueryable and taskAndNotificationAllCustomersModel is the List on object type:
public class TaskAndNotificationAllCustomersModel
{
public Guid TaskId { get; set; }
public NotificationTypes NotificationType { get; set; }
}
notificationData is of a type that has multiple properties, including TaskId and NotificationType.
The problem is that I get this exception:
Unable to create a constant value of type 'TaskAndNotificationAllCustomersModel'. Only primitive types or enumeration types are supported in this context.
EDIT:
After I made the List taskAndNotificationAllCustomersModel as a IQueryable, I get this error:
Unable to process the type '.TaskAndNotificationAllCustomersModel[]', because it has no known mapping to the value layer.
EDIT 2:
Tried it like this:
var notificationDataWithoutSettingsTypeTwo = notificationsData.Where(nd => taskAndNotificationAllCustomersModel.Any(tnac => tnac.TaskId == nd.TaskId && tnac.NotificationType == nd.NotificationType));
and I still get exception 1.