我在不同的例子,教程,博客等中看到过两种格式,但对于我的生活,我无法找到差异的解释.有什么区别
ICriteria crit = session.CreateCriteria(typeof(Cat));
Run Code Online (Sandbox Code Playgroud)
和
ICriteria crit = session.CreateCriteria<Cat>();
Run Code Online (Sandbox Code Playgroud)
我何时使用另一个?何时使用另一个?
可以在http://nhibernate.info/doc/nh/en/index.html#quickstart找到使用session.CreateCriteria(typeof(Cat))的教程示例.
使用session.CreateCriteria()的教程示例可以在http://ayende.com/blog/4023/nhibernate-queries-examples找到(表Blog而不是Cat)
非常感谢!!
当我在设计器视图中打开表单时,VS 2010似乎正在更新我的表单的designer.cs文件.
例如,假设我有一个带有System.Windows.Forms.Label类型标签的表单,我创建了标签,使得设计器文件具有(自动生成的代码)
this.myLabel.AutoSize = true;
this.myLabel.Font = new System.Drawing.Font("Tahoma", 8.25F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.myLabel.Location = new System.Drawing.Point(**25, 63**);
this.myLabel.Name = "myLabel";
this.myLabel.Size = new System.Drawing.Size(**101, 13**);
this.myLabel.TabIndex = 1;
this.myLabel.Text = "A simple windows label.";
Run Code Online (Sandbox Code Playgroud)
当我关闭设计师视图并再次打开它时,VS 2010 有时会改变它
this.myLabel.AutoSize = true;
this.myLabel.Font = new System.Drawing.Font("Tahoma", 8.25F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.myLabel.Location = new System.Drawing.Point(**29, 78**);
this.myLabel.Name = "myLabel";
this.myLabel.Size = new System.Drawing.Size(**124, 17**);
this.myLabel.TabIndex = 1;
this.myLabel.Text = "A simple windows label.";
Run Code Online (Sandbox Code Playgroud)
当我没有做任何事情而不是打开文件.
有谁知道为什么会这样?还有其他人经历过这样的事吗?
nhibernate ×1