Hi,
I have a serach page in my application, which takes following inputs:
- Forename
- Surname
- DOB
- Address
In order to serach I can provide exact/partial values to all of the above parameters or to none of them. In this case how should I write my LINQ query to get the output of the respective search from the DB.
Outline of the query I am expecting:
var Details = from t1 in context.tblPatient
where (t1.Forename.Contains("<Input Forename Value>") //this will be in serach criteria if Forename has input value
and t1.Surname.Contains("<Input Surname Value>") //this will be in serach criteria, if Surname has input value
and t1.DOB == <Input DOB Value> //this will be in serach criteria, if DOB has input value
and t1..Address.Contains("<Input Address Value>") //this will be in serach criteria, if Address has input value
select t1;
Thanx in Advance
Shilpa