Sunday, 29 January 2017

How to enum class create and call enum data in controller?

Firstly we create a class enum.cs -:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProjectName.Entity
{
    public class ProjectEnum
    {
        public enum Status : int
        {
            Created = 1,
            CheckedOut = 2,
            CheckedIn = 3,
            Published = 4,
            Deleted = 5
        }

        public enum SourceType : int
        {
            SBI = 1,
           Axis = 2,
            ICICI = 3,
        }
    }
}

int type = Convert.ToInt32(ProjectName.SourceType.SBI );

No comments:

Post a Comment