Public delegatebool Predicate
From its definition as you can see, the delegate references a return a bool value method, in the actual development, usually use Predicate
Function parameters shall meet the conditions of the referenced object, condition is met, the function returns true.
I didn't understand: Predicate
CodePudding user response:
The most typical usage is List
CodePudding user response:
Predicate is actually very early, then in Linq era, actually use the generic Func"Statement" is a kind of input and output of the statement, if you want to tangle "its implementation code is what kind of?" This is putting the cart before the horse, you only according to the practical textbook to knock on a function code, and "will this function as a parameter to entrust the variable", what kind of, you just understand code is
The code is what kind of? You absolutely no more than their cognitive function,
CodePudding user response:
It is around but for your topic is very simple to entrust form CanYi shapes such as entrusted also said that only one parameter and returns a boolJudging function do is simple just decided what kind of T satisfy conditions
CodePudding user response:
Consignment of the generic PredicateIn fact, List
Look from the function's signature, there is no difference, both of type T is to refer to, the return value is the function of bool, but after all both belong to different delegate type,
List
CodePudding user response:
If you have the size of the Linq probability is no more Predicate, is actually at least 10 years earlier than Linq (VB) in the 90 s to Predicate in the entrust, and List<> In the early IEnumerable<> And so on before the advent of widely used what ForEach, All, Any packaging and so on function, after the egg came first the chicken, so we think All the chickens are born eggs,CodePudding user response:
"Type declaration" is a very important concept, the compiler through it to check the bug, is there any design principle of a compilation system will more clearly understand the concept of compilation,If on the importance of the build system is vague, even if that is the best "crisp heart will explain, chaos, universal, yuan" is a convenient programming language, then nature will not be able to understand why real high-level programming language should be the first to establish a set of Type specification,
Statement is like a contract, illustrates the behavior of the framework, that according to the specification should be "how to do", rather than with what is "inside",
CodePudding user response:
I want to say is: in the form in the application, the function "judgment conditions" that can accept parameters from the form controls?CodePudding user response:
PredicateCodePudding user response:
Said along while you don't know what is a generic???????????CodePudding user response: