如何从类型获取NHibernate.Type.IType? [英] How to get NHibernate.Type.IType from a Type?

查看:84
本文介绍了如何从类型获取NHibernate.Type.IType?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试执行以下操作:

hibQuery.SetParameter("MyParameter", valueObject, valueType);

唯一的问题是此方法在第三个参数中期望NHibernate.Type.IType,但是valueType的类型为Type.如何将其转换为IType?

The only problem is that this method expects NHibernate.Type.IType in the third parameter, but valueType is of type Type. How could I convert this to IType?

任何小费的小费 sl3dg3

Thx for any tipps sl3dg3

推荐答案

尝试使用内置的NHibernateUtil.GetSerializable()方法.它采用CLR System.Type并返回相应的IType.更多文档: http: //elliottjorgensen.com/nhibernate-api-ref/NHibernate/NHibernateUtil.html#M:NHibernate.NHibernateUtil.GetSerializable%28System.Type%29

Try the built-in NHibernateUtil.GetSerializable() method. It takes a CLR System.Type and returns the corresponding IType. More documentation: http://elliottjorgensen.com/nhibernate-api-ref/NHibernate/NHibernateUtil.html#M:NHibernate.NHibernateUtil.GetSerializable%28System.Type%29

这篇关于如何从类型获取NHibernate.Type.IType?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆