小编Dav*_*vid的帖子

NHibernate show-sql - 为什么SQL显示无效?

我喜欢NHibernate中显示生成的SQL的功能.但是当我将它粘贴到SQL Server Management Studio中时,我意识到它实际上并不合适!

这是一个例子:

SELECT person0_.PersonId as PersonId1_0_, person0_.Title as Title1_0_, person0_.FirstName as FirstName1_0_, person0_.MiddleNames as MiddleNa4_1_0_, person0_.LastName as LastName1_0_ FROM Kctc.People person0_ WHERE person0_.PersonId=@p0;@p0 = 1
Run Code Online (Sandbox Code Playgroud)

由于指定参数p0的方式,这无效.它需要:

DECLARE @p0 int
SET @p0 = 1
Run Code Online (Sandbox Code Playgroud)

在SELECT命令之前.

我想我的问题是:为什么NHibernate没有显示它发送到数据库的ACTUAL SQL?为什么会这样显示呢?

有什么我想念的吗?

谢谢

大卫

sql nhibernate

2
推荐指数
1
解决办法
371
查看次数

C#:将成员变量放入列表中

假设我有一个方法接受IList或类似的东西作为参数:

public void JiggleMyList(IList<string> list)...
Run Code Online (Sandbox Code Playgroud)

有一种简单的方法可以传递对象列表的字符串成员吗?

我的意思是,例如,如果我有一个Person对象列表,它暴露了一个名为FullName的字符串属性,是否有一种快速的方法将所有Person对象的FullNames填充到方法参数中,或者我是否必须创建一个新的List并遍历Person对象:

List<string> fullNames = new List<string>;
foreach (Person person in people)
{
  fullNames.Add(person.FullName);
}
JiggleMyList(fullNames);
Run Code Online (Sandbox Code Playgroud)

我总是遇到这种情况,如果有一条捷径,那就太好了.

非常感谢

大卫

c# list

1
推荐指数
1
解决办法
2022
查看次数

如何在python中定义匿名类型

所以python是动态的.我应该能够毫不犹豫地向类实例添加属性.

我正在尝试这样做:

spam = None
spam.eggs = []
Run Code Online (Sandbox Code Playgroud)

但显然我无法添加属性None.

我如何定义spam为未定义的"空类"的实例,我可以在其中添加属性?

python dynamic python-2.7

1
推荐指数
1
解决办法
178
查看次数

如何使用XDocument linq查询查询站点地图

给出如下的站点地图:

<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:mobile=\"http://www.google.com/schemas/sitemap-mobile/1.0\">
<sitemap><loc>http://www.whyisxdocumentsuchapain.com/sitemap.kill.xml</loc><lastmod>2013-12-10T18:34:09Z</lastmod></sitemap>
<sitemap><loc>http://www.whyisxdocumentsuchapain.com/sitemap.destroy.xml</loc><lastmod>2013-12-10T18:34:09Z</lastmod></sitemap>
<sitemap><loc>http://www.whyisxdocumentsuchapain.com/sitemap.pillage.xml</loc><lastmod>2013-12-10T18:34:09Z</lastmod></sitemap>
<sitemap><loc>http://www.whyisxdocumentsuchapain.com/sitemap.etc.xml</loc><lastmod>2013-12-10T18:34:09Z</lastmod></sitemap>
</sitemapindex>
Run Code Online (Sandbox Code Playgroud)

我如何使用XDocument linq查询获取loc节点内的四个URL ?

它似乎完全打败了我.

c# linq sitemap linq-to-xml

1
推荐指数
1
解决办法
447
查看次数

标签 统计

c# ×2

dynamic ×1

linq ×1

linq-to-xml ×1

list ×1

nhibernate ×1

python ×1

python-2.7 ×1

sitemap ×1

sql ×1