Introduction
Anonymous methods are moreover related to Delegates. Anonymous methods are extension and improvement to delegates. They make the code easy and more readable. Anonymous methods increase performance of the application overall as and when used instead traditional delegate. With anonymous methods you can use delegate within same function.
This article written by “Ahtesham Shaikh”, Ahtesham Shaikh is C# and .NETtrainer, He not only writes for C# but also take trainings on C# for freshers and mid-level developers.
خوب حالا میرسیم به موضوع متد های anonymous . خوب حالا به صورت خلاصه متن بالا رو تشریح میکنیم:
خوب این anonymous متد ها باعث بهبود عملکرد delegate ها میشن و باعث میشن که خوانایی کد بره بالا.
خوب توی عکس بالا همون مدل سنتی delegate رو مبینیم بدون استفاده از anonymous متد ها.
ببینید به طور خلاصه بخوایم بگیم دیگه برای این که یه متدی رو سریع و در همون جایی که داریم کد رو مینویسیم بخوایم اجرا کنیم میایم از anonymous متد ها استفاده میکنیم. اینجوری هم سریعتره هم راحت تره هم خوانایی کد میره بالاتر و دیگه نمیخواد برای اجرای یک متد کوچیک بیایم و یه متد جداگانه براش تعریف کنیم.
لینک https://www.onlinebuff.com/article_anonymous-methods-in-c-with-an-example-step-by-step_64.html