自定义 SQL 查询和 SubSonic ActiveRecord?
我需要手动执行一些 SQL 查询,因为 ActiveRecord 不支持任何类型的 XPath 查询。
如果我能以某种方式发送查询并返回数据对象列表,我会很高兴。无需手动将每一列加载到对象的属性中,最简单的方法是什么
I'm needing to do some SQL queries manually because ActiveRecord doesn't support any kind of XPath query.
I'd love if I could somehow send in a query and it give me back a list of data objects. What would be the easiest way to do this without manually loading each column into an object's property
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SubSonic 有一个“CodingHorror”类,它使我能够执行内联查询,并且它有一个方法
ExecuteTypedList()
。所以我将尝试以这种方式加载东西并看看它是如何工作的SubSonic has a "CodingHorror" class which enables me to do inline queries and it has a method
ExecuteTypedList<T>()
. So I'm going to try loading things that way and see how it works那么您需要将 xml 加载到 C# 对象中吗?
听起来可能是这样...
如何将 XML 映射到 C# 对象< /a>
So you need to load xml into c# objects?
Sounds like this maybe...
How do I map XML to C# objects