c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
c# .net

Assign values to enum and how to get value from enum?

| | ASP-NET , CSharp

You can assign any values to the element of enumeration List. In this example, I will show to how to assign values and datatype and get integer value from enum.

public enum Language:short
    {
       english=1,
        tamil=2
    }

Here I assign value to the object by casting it, 

Country.Lang = (short)Language.english;