C# – using Attributes

Attributes in C# is used to embed custom metadata about the code / class in the code. Microsoft has a very good example on how to write your own custom attribute class:Microsoft Custom Attribute Example. Here is an example of Custom attribute call Developer. You can use this attribute by using DeveloperAttribute or simply use […]

Using Obsolete Attribute in C# .NET

C# has a built-in attribute that you can apply to any type in your C# code to designate a method as obsolete. To do that, before your method declaration, simply put in the [Obsolete] Attribute. For example: [Obsolete] private void testfunction() { //some code here } After you set this attribute in your code, every […]