Understand C# LAMBDA Expressions in only 2 minutes!

🔥 Wanna KNOW how to use LAMBDA in C#? THIS is the video you have been looking for!
🚀 C# Progress Academy - Become a senior C# developer: academy.tutorials.eu/p/csharp...
Here is the article: tutorials.eu/what-are-lambda-...
We'll make sure to turn you into a true developer in no time!
So, what is C#?
C# (pronounced "See Sharp") is a modern, object-oriented, and type-safe programming language. C# enables developers to build many types of secure and robust applications that run in .NET. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers. This tour provides an overview of the major components of the language in C# 8 and earlier. If you want to explore the language through interactive examples, try the introduction to C# tutorials.
And what is LAMBDA, then?
You use a lambda expression to create an anonymous function. Use the lambda declaration operator to separate the lambda's parameter list from its body.
Any lambda expression can be converted to a delegate type. The delegate type to which a lambda expression can be converted is defined by the types of its parameters and return value. If a lambda expression doesn't return a value, it can be converted to one of the Action delegate types; otherwise, it can be converted to one of the Func delegate types. For example, a lambda expression that has two parameters and returns no value can be converted to an Action delegate. A lambda expression with one parameter that returns a value can be converted to a Func delegate.
To learn more, make sure to watch the video, and we promise you that you'll become a C# developer by the end of the course! Have fun!
#csharp #coding #tutorial #learn #microsoft #net #lambdaexpression #dotnet
TAGS
Tutorials,Tutorial,Programming,Course,Learn,Step by step,guide,development,programmer,video course,video tutorial,learn how to,how to,visual studio,c#,.net,.net core,dotnet,visual studio 2019,core,code,asp,asp net,c sharp,coding,csharp,programming,api,rest api,rest,json,http,api testing,software development,c# tutorial for beginners,c# tutorial,c# restsharp tutorial,how to call post api in c#,csharp api,step by step,mvc,web api,rest api tutorial
tutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.
Stay tuned and subscribe to tutorialsEU: goo.gl/rBFh3x
C#: / @tutorialseuc
Facebook: / tutorialseu-1093802040...
LinkedIn: / tutorialseu
Discord: / discord

Пікірлер: 46

  • @tutorialsEUC
    @tutorialsEUC Жыл бұрын

    🚀C# Progress Academy - Become a senior C# developer: academy.tutorials.eu/p/csharp-progress-academy Here is the article: tutorials.eu/what-are-lambda-expressions-in-c-sharp/ We'll make sure to turn you into a true developer in no time!

  • @brrrrr256
    @brrrrr256 Жыл бұрын

    This does not go anywhere into a discussion of Delegates or Anonymous Methods - which is what Lambda Expressions are built on top of.

  • @DannysGalaxyTab

    @DannysGalaxyTab

    11 ай бұрын

    Well yeah but that would complicate the entire video wouldn't it.

  • @user-tp2ke9pv4e

    @user-tp2ke9pv4e

    3 ай бұрын

    @@DannysGalaxyTab Yes and unnecessarily so.

  • @RickSteadX
    @RickSteadX10 ай бұрын

    It's more of LINQ lesson than lambda expressions..

  • @Doks_Coders

    @Doks_Coders

    6 ай бұрын

    Exactly

  • @_keja_
    @_keja_ Жыл бұрын

    very well said. thank you

  • @racmanov
    @racmanov9 ай бұрын

    That is not lambda tutorial that is Linq tutorial

  • @cheeseyf1ghter
    @cheeseyf1ghter Жыл бұрын

    Great Video, thank you so much!! (What font is that?)

  • @LionKing_Mufasa
    @LionKing_Mufasa8 ай бұрын

    Thank you very much, you saved me at the last time of my assignment.

  • @Vykhari1
    @Vykhari1 Жыл бұрын

    Thank you!!

  • @barenyabinayak3255
    @barenyabinayak32558 ай бұрын

    Thank you Very much for this explanation within sort time.👍

  • @thatguyty96
    @thatguyty96 Жыл бұрын

    Thankyou sir. Also, youre accent is awesome.

  • @zazakage62
    @zazakage62 Жыл бұрын

    thanks

  • @caseyspaulding
    @caseyspaulding Жыл бұрын

    Thank you

  • @kimutaifelix9092
    @kimutaifelix909210 ай бұрын

    You are a good teacher

  • @TheHabibpk
    @TheHabibpk Жыл бұрын

    I really appreciate for very simple explaination

  • @tutorialsEUC

    @tutorialsEUC

    Жыл бұрын

    Glad you like it!

  • @MidnightTsuki
    @MidnightTsuki Жыл бұрын

    ... I feel like I was lied to in my life.

  • @user-eb7rr7yx2d
    @user-eb7rr7yx2d Жыл бұрын

    Simple, fast, clear.

  • @JonWoo
    @JonWoo7 ай бұрын

    How does this speed up your code?

  • @whitetiana3022
    @whitetiana3022 Жыл бұрын

    i absolutely despise the lambda operator because it does about 10 different things depending on how you use it.

  • @AndreasToth
    @AndreasToth5 ай бұрын

    You really shouldn't say that p is a Person but that it is a parameter which you have chosen to call p and which is of the list item type, i.e., Person.

  • @simonroyjonesuk
    @simonroyjonesuk Жыл бұрын

    Really helpful. Thanks

  • @MajorSquiggles
    @MajorSquiggles Жыл бұрын

    This is the worst explanation. It doesn't clarify anything and only leaves more questions. How does it know that p is a person? What is the point of typing out p => p.Age instead of just typing OrderBy(Age)? What do all the other parts of the expression do? They aren't just there for no reason. How does it know which way to sort? Maybe instead of sorting by oldest to youngest I want youngest to oldest. You mostly explained what the end result was but not how it works. I can't use something if I don't know how it works.

  • @DiegoSynth

    @DiegoSynth

    Жыл бұрын

    Yes, yes, yes. Exactly all of this. And when you are NOT a beginner, you write "those crazy for loops" very quickly, because you are doing the reasoning, and you know what you do. I really don't like when programming languages magically do things with no cohesion. And there's obviously explanation to how things happen, but going down into the rabbit hole ends up being much more of a pain than writing the for loop. Microsoft is an expert on magically doing things, hiding the backstage, and clogging the pipeline: You need an html page > you end up with a full environment, with automated authentication, DB bindings, razor pages, MVC models, middleware, etc., etc., etc. Horrible, unscalable, unportable, slow, shit.

  • @wiljagerhardt1219

    @wiljagerhardt1219

    Жыл бұрын

    p: This is a lambda parameter. It represents an individual element of the people collection during the sorting process. You can think of it as a temporary variable that holds each element of the collection one by one while sorting. =>: This is the lambda operator, which separates the lambda parameter (p) from the lambda body (p.Age). It indicates that the lambda parameter is used to produce the value on the right side of the operator. p.Age: This is the lambda body. It specifies the property Age of the p parameter. In this context, p represents each Person object in the people collection, and p.Age represents the age of each person. When the OrderBy method is executed with the (p => p.Age) lambda expression, it compares the Age property of each Person object and sorts the collection in ascending order based on these ages. In summary, (p => p.Age) is a concise way to provide a sorting key for the OrderBy method. It instructs the method to sort the elements based on the Age property of each Person object in the people collection. In Simple Terms (p => ... ): This is like a short formula that says "for each person in the list, do something." p: It represents one person in the list at a time. It's like a placeholder for each person while the computer is sorting them. p.Age: This says "look at the Age property of the person." Putting it all together, (p => p.Age) means "for each person in the list, look at their Age, and use that value to sort them from youngest to oldest." So, people.OrderBy(p => p.Age) takes the list of people and returns a new sorted list of people, with the youngest person first and the oldest person last, based on their ages. The original list remains unchanged.

  • @Banalny_Banan

    @Banalny_Banan

    8 ай бұрын

    OrderBy can sort something by int. So for it to work, and sort a list of Person objects you need to somehow help it to get those integers from Person objects. It gives you a Person (p is a variable name), then you return p.Age. lambda is a way to define a method with left hand side being input params and right hand side - what you return

  • @danielbrenjuk7291

    @danielbrenjuk7291

    7 ай бұрын

    P is just a variable name, the name person is the name of the list, and the p => p.Age just tells c# to sort through every element in the list by the value that is contained in the part of the list called Age. OrderBy tells the lambda to sort the list based on provided conditions

  • @JonWoo

    @JonWoo

    7 ай бұрын

    This is just a click bait marketing video for their business. It doesn't teach you anything of value.

  • @kitsurubami
    @kitsurubami Жыл бұрын

    What about using a Lambda expression without Linq

  • @tutorialsEUC

    @tutorialsEUC

    Жыл бұрын

    Yes, you for sure do that: stackoverflow.com/questions/1791510/can-lambdas-be-used-without-linq We can also create a video on that :)

  • @risingforce9648
    @risingforce964810 ай бұрын

    the "input" is "people" and the "expression" is "p"? that is the key for lamda? . I like your video but I am wondering the background behind lamda, cause I am reading the documetnation as well.

  • @awdsgrgde6979
    @awdsgrgde697911 ай бұрын

    One thing I don't get: how does the program know that person is an element in this list? I may be overcomplicating, but I am horribly stuck on this lambda expression syntax for some reason.

  • @programmingpersistence5716

    @programmingpersistence5716

    10 ай бұрын

    the OrderBy already knows its expecting a value to be there, give the value any name and it will represent each element in the array or List

  • @burakdemirh
    @burakdemirh Жыл бұрын

    so is sortedByAge an array?

  • @charichard09

    @charichard09

    Жыл бұрын

    Late but for future readers, sortedByAge is not an array but a List, created from sorting List people. Hope that helps!

  • @burakdemirh

    @burakdemirh

    Жыл бұрын

    @@charichard09 thanks man

  • @illumi98
    @illumi9811 ай бұрын

    Simple and clear. Thank you.

  • @user-jb6tn8jj2z
    @user-jb6tn8jj2zАй бұрын

    Basically if someone wants to understand and had to watch this bullshit The left side of the lambda expression is just parameter keep in mind that lambda is basically function but pretty small one so left side of the lambda is parameter and then comes the code what you want to do with that prameter

  • @slowfuse
    @slowfuse4 ай бұрын

    video is 4 minutes long. i'm out