C# code inside a property getter cannot be translated to a SQL query. You cannot use the
Situation
property in a LINQ query that's executed against the database.
Try:
var rawList = await this.GetByFilters(filters).ToListAsync();
var dataList = rawList
.Select(_ => new DataItem
{
Id = _.Id.ToString(),
Name = _.Person.Name + " (" + _.Situation.ToString() + ")",
})
.ToList();
Or:
var dataList = this.GetByFilters(filters)
.AsEnumerable()
.Select(_ => new DataItem
{
Id = _.Id.ToString(),
Name = _.Person.Name + " (" + _.Situation.ToString() + ")",
})
.ToList();