659 results found. Filter results

  • Using Structures as Records in C#

    The main reason to work with structures in most code is to create records that contain custom data. You use these custom data records to hold complex...

    In C#

  • Using Anonymous Methods in C#

    After you have the gist of using delegates, take a quick look at Microsoft’s first cut at simplifying delegates in C# 2.0 a couple of years ago. To...

    In C#

  • How to Seal a C# Class

    You may decide that you don’t want future generations of programmers to be able to extend a particular class. You can lock the class by using the ke...

    In C#

  • Using Expression-Bodied Members in C#

    Expression-bodied members first appeared in C# 6.0 as a means to make methods and properties easier to define. In C# 7.0, expression-bodied members al...

    In C#

  • The C#-Provided Constructor

    C# keeps track of whether a variable has been initialized and doesn’t allow you to use an uninitialized variable. For example, the following code ch...

    In C#

  • Generating Static in C# Class Members

    You can generate static in C# class members. Most data members of a class are specific to their containing object, not to any other objects. Consider...

    In C#