Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can ServiceStack.OrmLite ignore a property by attribute

public class User
{
   public long Id {get;set;}

   [References(typeof(City))]
   public long CityId {get;set;}

   [????]
   public City {get;set;}
}

I'm trying to use ServiceStack.OrmLite. I'm using both ReferenceKey(CityId) and Reference (City). ReferenceKey is for Db creation, Reference is for using object in my code.

like image 550
Oguz Karadenizli Avatar asked Jun 14 '12 02:06

Oguz Karadenizli


2 Answers

IgnoreAttribute .. Tested, it works.

like image 130
Oguz Karadenizli Avatar answered Nov 02 '22 11:11

Oguz Karadenizli


Try the [IgnoreDataMember] attribute.

This attribute will tell the ServiceStack libraries to ignore this property.

like image 2
Jim G. Avatar answered Nov 02 '22 13:11

Jim G.