Ошибка в выражении linq ASP .NET
public enum EnSituation { Sit1 = 1, Sit2, public virtual Person Person (get; set;) public EnSituation Situation { get { if (this.Sit1) return EnSituation.Sit1; if (this.Sit2) { if (this.Sit2) return EnSituation.Sit2; else return EnSituation.Sit; } } } var dataList = this.GetByFilters(filters) .Select(_ => new DataItem { Id = _.Id.ToString(), Name = _.Person.Name + " (" + _.Situation.ToString() + ")", }); return await this.rep.ToListAsync(dataList);
Что я уже пробовал:
when i run this code i recive the message error: Common.Domain.CustomExceptions.CustomValidationException: 'Exception: The specified type member 'Stituation' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.' Can anyone help me please?