Comments on: Mapping Enums to Strings and Strings to Enums in .NET http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/ ASP.NET Developer. ALT.NET Supporter. Pragmatic Programmer. Published Writer. Wed, 01 Dec 2010 20:34:08 +0000 hourly 1 By: James South http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-2348 James South Wed, 07 Jul 2010 08:37:40 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-2348 Nice post. This proved really useful for mapping enums to to types on a legacy database. Cheers!! Nice post. This proved really useful for mapping enums to to types on a legacy database. Cheers!!

]]>
By: AJ http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-2085 AJ Sun, 30 May 2010 07:08:18 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-2085 What if we have to bind the enum with database? Would it be possible by extending this extension method? What if we have to bind the enum with database? Would it be possible by extending this extension method?

]]>
By: Busby SEO Test http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-1000 Busby SEO Test Sun, 23 Nov 2008 22:14:23 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-1000 kevin, you are great, let me think about this post kevin, you are great, let me think about this post

]]>
By: Dang http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-999 Dang Tue, 18 Nov 2008 20:10:55 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-999 How's it going dude? Nice post, I'm sure this came in handy with the CEnumLibrary eh ;) How’s it going dude? Nice post, I’m sure this came in handy with the CEnumLibrary eh ;)

]]>
By: Alex http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-998 Alex Sat, 20 Sep 2008 18:33:19 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-998 Very Swanky- I'm sticking this in my toolbox class, will definitely come in handy in cleaning up some UI code of mine (specifically radio buttons which choose a value passed as an enum- Was if/elsing the crap out of it:D ) Very Swanky- I’m sticking this in my toolbox class, will definitely come in handy in cleaning up some UI code of mine (specifically radio buttons which choose a value passed as an enum- Was if/elsing the crap out of it:D )

]]>
By: Kevin Pang http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-997 Kevin Pang Sat, 20 Sep 2008 15:38:46 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-997 @Ryan I'm glad you found it helpful. I wish I thought of doing this before too. Now I'm faced with the question of whether or not to refactor all my old mapping functions to use this. :-P @Ryan

I’m glad you found it helpful.

I wish I thought of doing this before too. Now I’m faced with the question of whether or not to refactor all my old mapping functions to use this. :-P

]]>
By: Ryan Farley http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-996 Ryan Farley Sat, 20 Sep 2008 15:27:39 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-996 Kevin, thanks for posting this. That is quite cool - wish I had thought of doing that before. -Ryan Kevin, thanks for posting this. That is quite cool – wish I had thought of doing that before.

-Ryan

]]>
By: Christian http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-995 Christian Sat, 20 Sep 2008 11:48:34 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-995 thanks for your quick answer. now it's clear for me! greets, chris thanks for your quick answer. now it’s clear for me!
greets, chris

]]>
By: Kevin Pang http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-994 Kevin Pang Sat, 20 Sep 2008 09:29:25 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-994 @Christian Yes, you are correct. For this simple example using those two functions will suffice. But if you need to have, say, spaces in your description (which aren't supported in enums), or just a description that deviates from the enum value at all, then you would need to use another approach. That is where this implementation comes in handy. @Christian

Yes, you are correct. For this simple example using those two functions will suffice. But if you need to have, say, spaces in your description (which aren’t supported in enums), or just a description that deviates from the enum value at all, then you would need to use another approach. That is where this implementation comes in handy.

]]>
By: Christian http://www.kevinwilliampang.com/2008/09/20/mapping-enums-to-strings-and-strings-to-enums-in-net/#comment-993 Christian Sat, 20 Sep 2008 09:23:11 +0000 /post/Mapping-Enums-To-Strings-and-Strings-to-Enums-in-NET.aspx#comment-993 Hi, nict post, but one question: your description and enum-values are equal, so why don't you just use the built-in functions "Enum.ToString()" and "Enum.Parse()"? does this method give you any benefits? greets, chris. Hi,
nict post, but one question: your description and enum-values are equal, so why don’t you just use the built-in functions "Enum.ToString()" and "Enum.Parse()"? does this method give you any benefits?
greets, chris.

]]>