سؤال

I have in my mobile Service a table called AccountData. I want to include a simple search for Persons. Currently I have this:

return await _personTable.Where(Person => Person.Name == searchstring || Person.Email == searchstring).ToListAsync();

I want to go a step further, so it is not necessary to enter the exact same name...

هل كانت مفيدة؟

المحلول

As har07 wrote:

have you tried using .Contains() function : .Where(Person => Person.Name.Contains(searchstring))

It works!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top