Skip to main content

Chaining Methods - C# Intermediate Tutorials

CHAINING METHODS IN C#

INTERMEDIATE TUTORIAL

by Chamuth Chamandana



What are Chaining Methods?

=======================

Chaining Methods are used in C# in many ways. In extension methods and extension libraries such as LINQ, we use Chaining methods to pass the modified variable to the next method.



Example (built-in methods):

var result = "Hello World".Replace("World", "Chamuth").ToLower().Substring(5);



What we're going to talk about in this video

==================================

We're making a class known as StringDeveloper which creates strings from adding other strings which implements Chaining functionality. Which means every method returns itself, the context using return this; statement at the end of the changing of the content of the object which lets us call other functions in the object/class after.



Chaining Methods are also available in every other programming language including C, Java, JavaScript and etc.



Let me know what you want to know more about, in the comments section. If you enjoy please Subscribe to my channel and encourage us by liking our videos!!!



Comments

Popular posts from this blog

1 - Introduction to Sass and Variables | Sass Tutorials (SCSS)

This tutorial series at https://www.youtube.com/watch?v=upFW3wJoawk&t=1s&index=1&list=PLiugj09i4WUISuDdzEYu7FTCKWQhtO_lp will teach you how to use Sass in designing and developing your websites. We're going to be talking about, 1. Variables 2. Partials 3. Nesting 4. Mixins 5. Inheritance in this video. Please watch it till the end and share it if you like :D

Resource Hacker යොදා ගෙන Files Hack කරමු!

Resource Hacker යනු කුමක්ද? Resource Hacker යනු Windows Executable (*.EXE), Dynamic Link Library (*.DLL),  යන ෆයිල් වල අන්තර්ගතයට රිසි සේ ඇතුළුවීමට ඉඩ ලබා දෙන Application එකකි. මෙම ලිපිය කියවීමෙන් ඔබට එය පහසුවෙන් හසුරුවන ආකාරය ගැන දැනගත හැකි වේ  Resource Hacker භවිතයෙන් හානියක් සිදු වෙයිද? Resource Hacker විසින් සිදු කරන්නේ Encrypt වී ඇති ගොනුවකට Access වී එහි අන්තර්ගතය උරා ගෙන එය අපට දර්ශනය කර දීමයි. එම ක්‍රියාවේදී තමා යොදා ගන්නා EXE හෝ අනෙකුත් ගොනුවක Design එකට හානියක් විය හැකිය, එමෙන්ම එම ගොනුවේ ඇති Windows Executable Compression එකට හානියක් විය හැකිය. මෙවැනි අනතුරක් විය හැක්කේ, ඔබ අතින් සිදුවන අත්වැරැද්දක් නිසා පමණි. එමනිසා හොඳම දෙය වන්නේ, Backup File එකක් භාවිත කිරීමයි. Resource Hacker පාවිච්චි කරන්නේ කෙසේද? 1. පළමුව Resource Hacker නම් පරිගණක මෘදුකාංගය ඔබගේ පරිගණකයට බාගත කරගන්න. ඔබට මෙහි සංස්කරණ දෙකක් ලෙස බාගත කරගත හැක. ZIP Portable සහ Installer Executable ලෙස. http://www.angusj.com/resourcehacker/#downloa d 2. ඔබ පාවිච්චි කරන්නේ ZIP...

Microsoft Office 2016 ගැන අලුත් තොරතුරු

මේ වන විට Microsoft Office Suite එක ගැන නොදන්න කෙනෙක් නැති බව විශ්වාසයි.  කොහොම වුනත් Microsoft සමාගම විසින් Release කරන ලද Microsoft Windows 10  වෙළඳපොලේදී වෙශේෂ තැනක් ගත්නිසා Next Generation එකට වඩාත් සම්බන්දයක් ඇති  Microsoft Office 2016 ලොවට ලබා දීමට Microsoft සමාගම සූදානම් වී ඇත.  කලින් තිබූ Office Versions වලට වඩා මෙහි විශේෂ ලක්ෂණ බොහෝමයක් ඇත. කොටින්ම  කීවෝතින් මෙය Cloud ගණය ගැන අදික බරක් ඇති වැඩසටහන් මාලාවකි. එනම් බොහෝ  වැඩකටයුතු ඔබගේ Microsoft ගිණුම හා Sync වෙනු ඇත. මෙය Release වන්නේ කවදාද? 2015 සැප්තැම්බර් 22 වන දිනට මෙය Release වනු ඇත. මෙහි මිල කොපමණද? මෙය අමරිකානු ඩොලර් 145 පමණ වේ (රුපියල් 18 000). කෙසේ වුවද Mobile Devices පාවිච්චි  කරන කට්ටියට මේක නොමිලේ ම ලබා ගත හැක. කොහොම කීවත් සැප්තැම්බර් 24 වැනිදා  වීමටත් පෙර මේ වැඩසටහනට Cracks, Activators සෑදෙන බව මට විශ්වාසයි. මෙහි අලුත් Features මොනවාද? ක්ෂණික Document Sync කිරීම් පහසු ගොනු හුවමාරුව Insights පහසුකම සංස්කරණ ඉතිහාසයෙහි වෙනස්කම් නව ව්‍යාකරණ සොයාබැලීම් ...