c# - Why can my lambda expressions not use the same internal variable? -
I'm new to C # and it was working with lambda values.
My question is why does the parameter list not have the same variable in each of them? If you do note in print (q is variable) and in square (there is variable in c) and there are variables in add (x, y) and in ISL constanten (f variable is) what if i want to make them all the parameter The name, such as pizza can be done. It was on the tutorial I was looking at My second case is that if you make better code instead of using regular functions?
I think this is called Lambda Expression. I heard some different names on the tutorial video.
Question: Can only one variable be used in different lambda signage? I want to know if I can say that use all the variable symbols in my lambda expressions Code: An advantage of using delegates in this way It is that the function represented by the delegate can be changed at runtime. For example, suppose you have a representative for Then ... Now, everywhere you multiply, it will actually split. In this example, think of I used representatives in the past while using a variety of databases in a solution. Depending on the delegates would be different if the database was Oracle or MS SQL.
verb & lt; Int & gt; Print = index = & gt; Console.WriteLine (index);
Action & lt; Bool & gt; Print = q = & gt; Console.WriteLine (Q); Funk & lt; Double, double & gt; Class = c = & gt; C * C; Funk & lt; Double, double, double & gt; Plus = (x, y) = & gt; x + y; In the & lt; Double & gt; IsLessThanTen = f = & gt; F & LT; 10; Print (Haistyntan (square (plus (4, 5))); Console.ReadKey (); To answer your second question,
multiply
function
if (crazy demand iets) {majority = (a, b) => A / B; }
multiply as a variable, as a function and as a function, to change the value of this "variable" You must assign to a function that matches the signature you set.
Comments
Post a Comment