I'm using AutoMapper to map my Entity to my DTO. I have a property which compares two lists in my entity and return true or false if equal.
public bool AreAllEmployeesInformed
{
get
{
var result = (from a in Employees
join b in EmployeesInformed on a.Id equals b.Id
select a).Count();
if ((result == Employees.Count) && (result == EmployeesInformed.Count))
return true;
return false;
}
}
This is my mapping config
MappingConfiguration.CreateMap<Entities.Action, ForeManListItemDto>()
.ForMember(x => x.Informed, x => x.MapFrom(y=>y.Activity.AreAllEmployeesInformed))
I want to map this to my DTO as true or false, but AutoMapper refuses. How can I fix this?
The error it gives me is "The specified type member 'Activity' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported."
Thanks in advance.