How to do a LIKE query with linq?

前端 未结 8 1609
予麋鹿
予麋鹿 2020-12-03 02:57

How can i perform an LIKE query within Linq?

I have the following query i would like to execute.

var results = from c in db.costumers
              w         


        
8条回答
  •  萌比男神i
    2020-12-03 03:19

    Try using string.Contains () combined with EndsWith.

    var results = from c in db.Customers
                  where c.FullName.Contains (FirstName) && c.FullName.EndsWith (LastName)
                  select c;
    

提交回复
热议问题