ObservableCollection Contains doesnt work correctly
hi guys! when press button find throwexeption if use after start findbycode find work correctly
public icommand findbycode { { return new relaycommand(() => { libmaterials = new observablecollection<libmaterial>( _repo._context.libmaterial.where(material => material.code.contains(code))); }); } } public icommand find { { return new relaycommand(() => { ////loadbook(); ////code = ""; if (findgenre == null) { libmaterials = new observablecollection<libmaterial>( libmaterials .where(material => material.author.contains(autor)) .where(material => material.name.contains(bookname))); } else { libmaterials = new observablecollection<libmaterial>( libmaterials.where(material => material.tree_id == findgenre.id) .where(material => material.author.contains(autor)) .where(material => material.name.contains(bookname))); } }); } }
libmateriaks not null if change code
.where(material => material.name==bookname));
all work good.
but want smart find(if inpu 3 symbol in collection find first 3 symbol)
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment