This is how i use linq with my entity. All i want to do is to be able to add condition dinamically. I have conditions in string. For example notes == 'some words'
or DokumentID == 4
. I would love to use that somehow as condition in linQ. I can provide the name of column in database and value searched in two different string. But still i don't have idea how to add it to my linq.
Here is my code from program:
ListImport.Clear();
using (var db = new Minorlex_MPIPSEntities())
{
var query = from s in db.tbl_Dokumenty
where s.IdDokumentu == 15
select s;
foreach (tbl_Dokumenty Dokument in query)
{
ListImport.Add(Dokument);
}
}
and i want to try if i can take the variable string and use it like status in here. To use a variable in string and provide it to linq with added condition to it.
query.Where(x => x.status < 0);