C# Tutorial

Top C# tutorial for beginners to learn C Sharp programming language right from Environment setup, Basic Syntax, Framework, OOPS Concepts, Data Types, Assembly, LINQ, WPF etc. explained with the help of examples

C# Overview & Evolution of C# Language

C# language was introduced by Microsoft in the middle of 2000 and it was developed by Anders Hejlsberg. It is an elegant and type-safe object oriented language which enables the developers to build the secure and robust applications which runs on .NET Framework.

Introduction of .NET Framework

The .NET Framework is a development platform for application which provides services like building, deploying, and running applications of desktop, web, and phone and web services. It can be called as Development platform or Execution environment which consists of tools and technologies, to develop distributed applications and distributed web services.

C# Metadata, Metadata Tables and Benefits

In.NET, metadata is binary information which describes our program that is stored either in common language runtime portable executable file or in memory. When you will compile the code into a portable executable file, metadata is inserted in one portion of the file and the code is converted into Microsoft Intermediate Language (MSIL) and then inserted into another portion of the file.

C# - Common Language Intermediate (CIL)

The common language intermediate is also known as Microsoft Intermediate Language (MSIL). It plays an important role in .Net Framework. It acts as the intermediate language which exists between source code and machine code at the time of compilation. The source code of the .Net application can be written in any language such as VB.Net, ASP.Net etc.

C# - Class and Objects

A class enables us to create our own custom types by grouping variables together of different types, methods and events. A class is just like a blueprint, which defines the data and behaviour of a type. If the class is not declared static then the code can used by creating objects or instances which are assigned to a variable.

C# Assembly - How to create and share assembly

An assembly is a single deployable unit which contains all the information about the implementation of classes, structure and interfaces. The executable code is stored in Assemblies. The assemblies are the self describing unit and the programs in .Net are constructed through these assemblies.

C# Garbage Collection

In the .Net Framework garbage collector manages the allocation of memory and release the memory of the application. Every time when the new object is created the common language runtime allocates the memory from the managed heap and as long as the address space is available in the managed heap, the runtime continues to allocate the space for new objects.

C# Indexers

C# indexers allow us to create classes which act like virtual arrays. The instances of the class can be accessed using the [] array access operator. The indexer in C# is similar to defining operator [] in C++, but is considerably more flexible. For classes that encapsulate array or collection like functionality, using an indexer allows the users of that class to use the array syntax to access the class.

C# Exception Handling - User-Defied Exceptions

An exception is a problem which arises during the execution of the program. The exception handling helps us to deal with an unexpected or expected problem which arises while program is running. It uses the try, catch, finally and throw keyword.

C# Inheritance - Single, Hierarchical, Multilevel & Multiple Inheritance

Inheritance is one of the important characteristic of the object oriented programming. It enables us to create new classes that can be reused, extended and modify the behaviour which is defined in the other classes. The class members which are inherited are known as base class and the class which inherits those members are known as derived class.

C# Abstract Classes

The abstract classes are defined by the keyword abstract and are used to define a base class. They are the one of the essential feature provided by C#. They are used when we don’t want to create objects of the base class. The abstract class can contain either the abstract methods or non abstract methods. Rules to be applied:

C# Structures

In C# the structures are the value type data type that contains variables, methods, properties, events, etc. It also simplifies the program and enhances the performance of code. It also improves the speed and memory usage. It helps us to make a single variable hold related data of various data types.

C# Delegates and Events

The delegates in C# are similar to the function pointer in C or C++. It is an object that refers to a method. By using delegate it allows the programmer to encapsulate a reference to a method inside the delegate object. Then this object can be passed to the code which can call the referenced method without having to know at compile time which method will be invoked.

C# Collections

In C# a collection is known as the group of objects. In C#, .NET Framework provides specialized classes for the data storage and retrieval. Collection classes provide facility of stacks, queues, lists and hash tables. Collection classes implement the same interfaces and these interfaces can be inherited to create new collection classes.

C# XML Read and Write

The XML is the Extensible Markup Language. It is basically designed to improve the functionality of the web by providing flexibility and adaptable information identification. It is a language for structured documentation. The XML is called extensible because it is in a not fixed format like HTML. XML is a `metalanguage' a language which describes other language and let us designs our own customized markup languages for different types of documents.

C# Windows Presentation Foundation (WPF)

The WPF is a user interface (UI) framework that creates a rich, interactive client application. The WPF development platform support a set of application development features which includes a resources, layout, graphics, controls, application model, data binding, documents and security.

Language Integrated Query (LINQ)

The LINQ or Language Integrated Query is constant query syntax in C# which is used to save and retrieve the data. It is one of the most important feature of .Net Framework. It consists of operators which are used to query data. To query the data it needs to be encapsulated as an object. If the data source is not an object, then firstly it is converted into an object for the LINQ to perform a query.

Popular Videos


How to improve your Interview, Salary Negotiation, Communication & Presentation Skills.

Got a tip or Question?
Let us know