How to map uint in NHibernate with SQL Server 2005

前端 未结 4 1902
生来不讨喜
生来不讨喜 2021-01-19 01:42

I have a property of type uint on my entity. Something like:

public class Enity
{
   public uint Count {get;set;}
}

When I try to persist t

4条回答
  •  情话喂你
    2021-01-19 02:13

    You could try to add another private "mirror"-property.

    public class Enity
    {
       public uint Count {get;set;}
    
       private long CountAsLong 
       { 
         get { return Convert.ToInt64(Count); } 
         set { Count = Convert.ToUInt(value); }
       }
    }
    
    
    

    Of course you should do this only if it could not be solved by the mapping.

提交回复
热议问题