Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 668 Bytes

README.md

File metadata and controls

29 lines (26 loc) · 668 Bytes

DynamicWhere

public class User
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string FamilyName { get; set; }
}
var dyn = new List<DynamicModel>();

dyn.Add(new DynamicModel()
{
    ComparisonMethod = ComparisonMethod.DoesNotContain,
    PropertyValue = "s",
    PropertyName = "FamilyName"
});
dyn.Add(new DynamicModel()
{
    ComparisonMethod = ComparisonMethod.Contains,
    PropertyValue = "a",
    PropertyName = "Name"
});

var people = _dbContext.Users.DynamicWhere(dyn).ToList();

People variable is equal to all records that Name property contain a and FamilyName property does not contain s.