asp.net mvc - Linq a.Metadata.ToLower().Contains -
i have problem list of objects, 1 have field example metadata, null. when use a.metadata.tolower().contains(sometext) shows me error, null value. how can fix ? p.s. see problem first time, tried same other list of objects 1 have null fields , works, can problem ?
instead of
.where(a => a.metadata.tolower().contains(sometext))
do
.where(a => a.metadata != null && a.metadata.tolower().contains(sometext))
Comments
Post a Comment