Category: C#

These C# tutorials will help you learn the basic concepts of C# and object oriented programming.You will find articles and snippets related to common scenarios.

Action,Func and Predicate in .NET

Delegate in .NET is a type which can refer to a method.So if we have a delegate type declared as

then the above delegate can point to a method which accepts two integer arguments and returns an integer type

...

Set log4net log file path dynamically in c#

log4net is an open source library used for logging the information during program execution.It is one of the most popular logging libraries used in c#. Sometimes we need to decide and set the location of the log file at runtime.To...

Learning a new Programming Language in 2016

If you have ever planned to learn a programming language then you might have felt overwhelmed.This is how most of the programmers feel when they are planning to add a new language to their skill set. Since today there are...

Exception handling in C#

C# provides managed exception handling.This means that we don’t have to manually check the code for exceptions.Instead execution is automatically transfered to the appropriate part. An Exception is an error which happens during program execution or runtime.Exception handling allows us...

Min and Max DateTime values in C#

Any variable of type DateTime can be assigned appropriate values for handling date and time data.Any value which lies between the DateTime.MaxValue and DateTime.MinValue can be assigned to a DateTime variable. Following example demonstrates this. Ticks is a property of...

Assembly in .NET

Assembly is an important part of any .NET application.Compiling any application builds an assembly. Following are the main componenets of an assembly: 1 Intermediate language code 2 Metadata 3 Assembly Manifest 4 Resources Intermediate language When we compile any c#...

RESTful Services

REST stands for representational state transfer.It is an architectural pattern for creating client server applications.There are other client server communication methods such as SOAP based web services ,remoting and RPC. Web Services are used for creating applications which communicate with...

Constructor chaining in C#

As we know method overloading means that class can define different versions of the same method.This means a method with the same name can be defined with different signatures in the same class. For example we can define following methods called...

Reading and Writing Text Files in C#

StreamWriter class is part of the System.IO namespace.It is used for writing to streams in particular encoding.We can use it to write text files. Write to the text file To write to a text file using StreamWriter we implement the following...

Introduction to log4net in c#

In a application logging is a useful feature that allows us to debug the problems in our application.For example an application can write error information to a file in the case of fatal exception.This information can be used for troubleshooting. Though...