Oguz Karadenizli
Oguz Karadenizli

Reputation: 3505

How can I Map enum properties to int in ServiceStack.OrmLite?

Maybe the answer will be "by design". But enum properties are mostly used for filtering. So they need "Db Index". But If you map them to varchar(max) we could not create index for them in Sql Server.

So if answer is "by design" could you add [Flag] style binding alternative.

Upvotes: 0

Views: 926

Answers (1)

Oguz Karadenizli
Oguz Karadenizli

Reputation: 3505

This is architectural mistake to me and no solution.

So we made

int UserTypeId {get;set,} // It is for db
UserTypeEnum UserTypeEnum {get;set;} // It manipulates UserTypeId and read from UserTypeId

Upvotes: 1

Related Questions