Im trying to make a query in asp.net models.
Im understand we can get a record by a primary key with ModelContext.Table.Find(id)
, and a list of all items with ModelContext.Table.ToList()
...
My question is, how i can get a single item and entire list of items looking in another columns? for example name and lastname.
Something like ModelContext.Table.Find(new {name = "Stefan", lastname = "Luv"})
and ModelContext.Table.FindAll(new {"country"="usa"})
Thanks.