skip to main
|
skip to sidebar
Csharp
Monday, March 16, 2009
Generic Method for Parsing a value into an Enum.
public static T ParseEnum
(string value)
{
return (T)Enum.Parse(typeof(T), value);
}
usage: MyStatusEnum status = ParseEnum
(reader["Status"].ToString());
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
▼
2009
(8)
►
July
(1)
►
June
(2)
►
May
(4)
▼
March
(1)
Generic Method for Parsing a value into an Enum.
►
2008
(1)
►
October
(1)
About Me
Vikas Kumar
View my complete profile
No comments:
Post a Comment