-
Notifications
You must be signed in to change notification settings - Fork 169
Description
i have [NotMapped] property in entity, i want to apply filter on this property like this
public class MyEntity : IEntity
{
public Guid ID { get; set; }
public string Code { get; set; }
public string Description { get; set; }
[NotMapped]
public string CodeAndDescription => Code + " / " + Description;
}
var pre = ExpressionBuilder.New(true);
if (filter.PublicFilter != null)
{
string keywords = filter.PublicFilter.ToLower().Replace("İ", "i").Replace("ı", "i");
pre.And(x => x.CodeAndDescription.ToLower().Replace("İ", "i").Replace("ı", "i").Contains(keywords));
}
Of course, a solution can be found in these codes by applying a separate LINQ for Code and a separate LINQ for Description. This solution will not work when there is a more complex situation. But I simply wrote these codes to ask how to apply LINQ to a NotMapped field with expressionbuilder.
how can I do that