Im tratando de obtener algunos datos con el metodo createSQLQuery NH comoNHibernate createSQLQuery
IList<Logistic> LCollection = sess.CreateSQLQuery(@"select * from some_schema.logistic")
.SetResultTransformer(Transformers.AliasToBean(typeof(Logistic)))
.List<Logistic>();
clase logística es
public class Logistic
{
public virtual long? l_id { get; set; }
public virtual long? carrier_id { get; set; }
...
}
mapeo
public class LogisticMap : ClassMap<Logistic>
{
public LogisticMap()
{
Table("some_chema.logistic");
Id(x => x.l_id).GeneratedBy.Sequence("some_chema.logistic_sq");
Map(x => x.carrier_id);
...
}
}
pero tengo el error
The type System.Decimal can not be assigned to a property of type System.Nullable`1[System.Int64] setter of MyNamespase.Logistic.l_id
¿Alguna idea de lo que puede estar mal?
compruebe si su columna l_id ins la db tiene datos decimales – Baz1nga