c# - Inside of a lamba expression trying to divide two values and compare to another value -
C # - After trying to split the two values into the lambda expression and after comparing the other value, check it After that they are not equal to zero Lambda does not seem to work in the expression, but (which I think) works in is the equivalent foreign exchange expression I mean by working, that does not satisfy any expression from the test data; The behavior of foreign code shows (the value found after the execution of the foreign currency code remains false, however, in the Lambda expression it will contain elements after executing the code in the list). I'm new to Lambda and Lynx's expressions, what's going on here?
The Linux expression is as follows:
IEnumerable & lt; DataModel & gt; List = dataList.Where (t = & gt; TA! = Null & amp; amp; tt! B = null & amp;;;;; ;; com; 1. compile value ((t B. Value / TA value)) = 0); This works in the preceding statement:
var found = false; Foreign currency (Miscellaneous data in data list) {if (data. A == blank; data.b == empty) {continue; } Value value = (double) data. B Value / data.a Value; If (data.Compute1.Value.CompareTo (value)! = 0) {found = true; }} Update: I The problem is fixed by pressing Comput 1, TA, and TB, although VS Tells me that this is unnecessary.
These are not equal pieces of code. Your foreach loop stops searching for a moment, where it finds the data element where either A or B is zero. Your lambda checks all the elements, even if in the last one, A == faucet or B == is zero. With the continuation of the nearest equivalent equivalent, the brake has to be changed.
var found = false; Foreign currency (Miscellaneous data in data list) {if (data. A == blank; data.b == empty) {continue; } Value value = (double) data. B Value / data.a Value; If (data.Compute1.Value.CompareTo (value)! = 0) {found = true; }}
Comments
Post a Comment