Category: C#

Anonymous Type Example

The simplest example of the anonymous type is to use the var keyword and assign the non-null initial value to the variable declared with var keyword. Below is a sample soucrecode demonstrating the simple anonymous type example. The above code is similar to the code written like below.

5 Alternative ASP.NET MVC View Engines

If you a ASP.NET MVC Web developer , you would have noticed that by default ASP.NET MVC includes 2 View Engines “Razor View” and “ASPX View”. In this article , we will explore other different View Engines(third party) available in ASP.NET. 5 Alternative ASP.NET MVC View Engines 1. Spark Spark is a open source view engine for ASP.NET MVC projects as well as Castle MonoRail…

C# Compiler Warning – CS4024 the callerlinenumberattribute applied to

In this blog post, you’ll learn more about the C# Compiler Warning – CS4024 and the related message description C# Compiler Warning Code CS4024 C# Compiler Description for the Code :CS4024 The CallerLineNumberAttribute applied to parameter ‘{0}’ will have no effect because it applies to a member that is used in contexts that do not allow optional arguments

mc:Ignorable attribute in Windows Phone XAML Page

When a new Windows Phone Project is created, it creates the MainPage.xaml by default. This page contains the attribute mc:Ignorable=”d” This is an attribute which indicates to the compiler to ignore any other attributes that starts with “d”. For example, the attributes d: DesignHeight or d: DesignWidth is a typical example of the compiler ignoring the height and width attributes. These attributes are only used…

How to Implement Interfaces in C# ?

Once the interface is created or available , you might want to implement the functionality of the interface in your class . How to Implement Interfaces in C# ? To implement an interface , we must declare and provide implementations for each functions in your class. Below is a sample code snippet that demonstrates how to implement interface in C#.