In this Chapter we will learn about Func<x,y> delegate and its real time implementations and will see how we can create centralize functions to filter generic list. Basic Definition Func delegates offer a straightforward approach to defining and utilising methods by passing them as parameters and returning them as results. Func<> is a delegate type for methods that return a value. we can have up to 16 parameters, with the return type always being the last type parameter. It’s useful for passing methods as arguments or working with lambda expressions in a clean and concise way. Syntax Consider below syntax, it has two parts left and right. Right side of lamba expression is return value and Left side of lamba expression is input parameters. Example: This is simple code using System; class Program { static void Main () { // A Func delegate that adds two integers Func< int , int , int > add = (x, y) => x + y; int ...
.Net core Advance topics / Follow me @ https://medium.com/@devesh.akgec