foreach (var name in parent.names) { if name.lastname == null) { Violated = true; this.message = \"lastname reqd\"; } if (!Violated)
During testing I found that foreach loop after break go to the loop beging and not out of the loop. So I changed foreach into for and break in this case work correctly- after break program flow goes out of the loop.