c# linq crm select where contains -
i'm trying select crm entity "contains
" key.
i tryed this:
var results = crm.new_supplycontractset .where(x => x.new_city != null && x.new_city.name.contains("mychars")) .tolist();
but give me error:
invalid 'where' condition. entity member invoking invalid property or method.
and this:
var result = ( c in crm.new_supplycontractset in crm.new_comuneset a.new_name.contains(comune) c.new_city.id == a.id select c) .tolist();
but can't figure out how it. second try gives me error:
a 'selectmany' operation must preceeded 'where' operation filters entity id.
how can select contains filter? "x.new_city
" entity ref crm.new_comuneset.
ps: i've read inaccessibility of "entity.entityref.name.contains()
" because "name" property not ground level , it's not available ".contains
" check.
you can try converting field , filter lower or upper case.
var results = crm.new_supplycontractset .where(x => x.new_city != null && x.new_city.name.tolower().contains(("mychars").tolower())) .tolist();
i think better if use startswith instead (and if possible).
Comments
Post a Comment