我正在尝试使用以下语句来获取具有我所追求的字段的实体:
retVal = session.CreateCriteria(typeof(MyEntity))
.CreateAlias("MyEntityProperty", "MyEntityProperty")
.Add(Restrictions.Eq("MyEntityProperty.Year", year))
.SetProjection(
Projections.Distinct(
Projections.ProjectionList()
.Add(Projections.Property("Property1"), "Property1")
.Add(Projections.Property("Property2"), "Property2")
.Add(Projections.Property("MyEntityProperty.RegisteredUser"), "MyEntityProperty.RegisteredUser")
.Add(Projections.Property("MyEntityProperty.CompanyInfo"), "MyEntityProperty.CompanyInfo")
)
)
.SetResultTransformer(Transformers.AliasToBean(typeof(MyEntity)))
.List<MyEntity>()
.Cast<BaseMyEntity>();
Run Code Online (Sandbox Code Playgroud)
MyEntity是我想要返回的实体,MyEntityProperty是MyEntity的一个属性,它是另一个实体(MyEntityProperty类型).
我得到的错误是 Could not find a setter for property 'MyEntityProperty.RegisteredUser' in class 'MyEntity'
AliasToBean转换器是否无法处理子实体?或者还有什么我需要做的才能让它发挥作用?
我正在尝试使用ABCPDF.net 8从html内容创建pdf.
使用AddHtml方法时,这很好用.
但是,我也需要接受样式,所以我需要使用AddImageHtml.但是使用此方法会导致w3wp进程抛出异常.当我使用Reflector调试代码时,异常似乎来自不同的地方,让我觉得它可能是某种记忆的东西......(很好,具体,我知道).
我的abcpdf代码就像......一样简单
global::WebSupergoo.ABCpdf8.Doc doc = new WebSupergoo.ABCpdf8.Doc();
doc.AddImageHtml(test);
Run Code Online (Sandbox Code Playgroud)
...而且我在页面渲染中这样做.
任何人都有任何abcpdf在w3wp进程中抛出泛型异常的经验?