I have 4 rows in my DB (example), I load data from DB to DataModel like Regex for columns Code and Serie:
Id;Code;Serie
1;XXX;XXX
2;XXX;XXX_A
3;WWW;YYY_A|YYY_B
4;CCC;XXX_A
When I use LINQ query below with input parameters Code = XXX and Serie = XXX_A, I got 2 results, but the right result is only got a row with ID == 2
model = _seriesData.Where(s => (s.Code.IsMatch(code) && s.Type.IsMatch(serie)));
I do not know where is a problem, but LINQ works only with one parameter
In my model column Code and Serie are Regex types
UPDATE
For Code row Regex I also use regex like this XXX_A|XXX_B|YYY_A Data in the _seriesData variable are ok, but the result is wrong
DataModel
public class SerieModel
{
public Regex Type { get; set; } // name of serie
public Regex Code { get; set; }
}
Does anybody help me?
.Whereclause will cause the data to be retrieved from the database and the clause will run locally. This may involve huge numbers of records being sent over your network and be very inefficient.