THESE FORUMS ARE NOW FROZEN
Please choose "Forums" from the Main menu of www.entityspaces.net to get to our new forums.

Handling enum value fields?

rated by 0 users
This post has 0 Replies | 1 Follower

Top 50 Contributor
Posts 43
dhiggins Posted: 10-28-2009 9:07 AM

I've searched around through the forums and the available templates and didn't see anything like this, so I thought I'd throw it out there.

I'm generating code from a DB where several tables have fields that I'd like to make to enumerations in my code (either nullable or not).

I can always create another property to reflect the cast enum value, like so:

        Public Property MenuItemTypeEnum() As MenuItemTypes?
            Get
                Return DirectCast(Me.MenuItemType.GetValueOrDefault, MenuItemTypes)
            End Get
            Set(ByVal value As MenuItemTypes?)
                Me.MenuItemType = value
            End Set
        End Property

But, ES has a sweet code gen, so why not have it do that work right?<g>

 

So, question is, is this already a feature of the templates, or is there a template for this sort of modification?

If not, I could make the change to the applicable template, but would anyone else be interested in that? Maybe even integrating it into the standard ES templates (I'd rather not have to maintain the changes if possible, plus, I could see it being generically applicable feature.

Page 1 of 1 (1 items) | RSS
Copyright © 2005 - 2009, EntitySpaces, LLC