Say we have a model
public Foo
{
string Something {get;set;}
string SomethingElse {get;set;}
string AnotherThing {get;set;}
}
What is the most concise way of determining if any of those fields contain any string from a List?
var foo = new Foo
{
Something = "If Liverpool don't beat Fulham this evening I will cry",
SomethingElse = "I hope I have that TekPub membership for Xmas",
AnotherThing = "I wish NCrunch was a bit cheaper"
};
var keywords = new List<string> { "Liverpool", "glosrob", "stackoverflow" };
Would pass on foo.Something containing the word ‘Liverpool’.
1 Answer