21 Ekim 2014 Salı

Enum casting

 public enum SocialType
        {
            None=0,
            Facebook=1,
            Twitter=2,
            Instagram=3,
            Google=4
        }
       
        public static byte GetSocialType(string type)
        {
            var test = (SocialType)Enum.Parse(typeof(SocialType), type);
            return (byte)test;
        }