OrmLite: Enum

722 views
Skip to first unread message

Lex

unread,
Feb 4, 2012, 1:43:37 AM2/4/12
to ServiceStack .NET Open Source REST Web Services Framework
If I have an Enum field in table definition, OrmLite saves it as
varchar(255).
I want to store it as int.
How should I do that?

Demis Bellot

unread,
Feb 4, 2012, 1:51:39 AM2/4/12
to servic...@googlegroups.com
We don't support that behaviour out of the box by default - just make the property on your POCO an int.


Lex

unread,
Feb 4, 2012, 6:02:07 AM2/4/12
to ServiceStack .NET Open Source REST Web Services Framework
Are there any attribute field to skip it by OrmLite?
Something like:

public int SomeField { get; set; }

[SkipItByOrmLite]
public MyEnumType SomeEnumField { get { return (SomeEnumType)
SomeField; } set { SomeField = value; } }




On Feb 4, 1:51 pm, Demis Bellot <demis.bel...@gmail.com> wrote:
> We don't support that behaviour out of the box by default - just make the
> property on your POCO an int.
>

Demis Bellot

unread,
Feb 4, 2012, 6:14:40 AM2/4/12
to servic...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages