views:

13

answers:

0

Basically my object doesn't have a LastupdateDate field but the database does and requires is to be mapped. Does anyone have an idea how I could map the 'lastupdatedate' column without changing the AClass class?

This is a basic table..........

ATable
{
 id INT, lastupdateDate DATETIME
}

Business class that is maps to......................

public class AClass
{
  public virtual int Id{get;set;} 
}

Fluent map.................

public AClassMap : ClassMap<AClass>
{
   public AClassMap()
   {
     Id(x=> x.Id); 
     Map(DateTime.UtcNow,"LASTUPDATEDATE")

   }

}

related questions