Hiding a field or use TypeConverter?

Posts   
 
    
edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 25-May-2009 19:50:40   

Using 2.6 (April 15th, 2009).

I have a date field that is an int in the db (sample data 20091005). I would like to only expose the field as a DateTime.

So, is TypeConverter the right way to do this?

Or is there a way to hide the generated member so that I can add my own property to the partial class that does the conversion?

Thanks

edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 25-May-2009 22:26:41   

I did it with a TypeConverter. Works great.

hazel.leo
User
Posts: 1
Joined: 13-Aug-2009
# Posted on: 13-Aug-2009 19:11:19   

I think if it's working fine, then you should carry on...

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 13-Aug-2009 21:26:49   

Type Converters are the way to go. If you choose not to generate the field it will not be available in the entity for your partial class method to work on.

Matt