Double filter with lambda expression
I'm create a product edit form, this form has following TextBox, Id, Code,
Width, Height, and Color
Id and Code can't repeat, so I want make a "checking" for Code repeat in
my Code_TextChanged event
I had try fallowing lambda expression for checking (products is a List)
if(products.Where(x=>x.code.Equals(Code.Text)).Count(g=>!g.id.Equals(Id.Text))
0) CodeExist = true;
I don't know why, when I opened a register, it will mark CodeExist is true
How to I can make a condition, for filter product.code.Equals(Code.Text)
and !product.id(Id.Text) ?
No comments:
Post a Comment