﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Gunnar Liljas commented on NHibernate: Why do we need to specify the query type twice?</title><description>@Dmitry
  
  
[http://code.google.com/p/nhlambdaextensions/](http://code.google.com/p/nhlambdaextensions/)  
  
[www.lostechies.com/.../...nh-contrib-is-alive.aspx](http://www.lostechies.com/blogs/derickbailey/archive/2009/05/13/fluentnhibernate-contrib-fnh-contrib-is-alive.aspx)</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment12</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment12</guid><pubDate>Tue, 26 May 2009 17:42:31 GMT</pubDate></item><item><title>Dmitry commented on NHibernate: Why do we need to specify the query type twice?</title><description>It should have been s.CreateCriteria&lt;Blog&gt;().. The blog swallowed the tag.
</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment11</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment11</guid><pubDate>Tue, 26 May 2009 16:32:54 GMT</pubDate></item><item><title>Dmitry commented on NHibernate: Why do we need to specify the query type twice?</title><description>Why not have overloads like this?
  
  
var blogs = s.CreateCriteria
&lt;blog().AddRestriction(b =&gt; b.Title == "Ayende @ Rahien").ToList();
  
  
var blogs = s.CreateCriteria
&lt;blog().AddRestriction(b =&gt; b.Title == "Ayende @ Rahien").Project(b =&gt; b.Id).ToList();
  
  
This way LINQ provider would not be as imporant.
&gt;</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment10</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment10</guid><pubDate>Tue, 26 May 2009 16:30:48 GMT</pubDate></item><item><title>Jason Meckley commented on NHibernate: Why do we need to specify the query type twice?</title><description>the angle brakcets where lost with the last post.
  
  
var blogs = s.CreateCriteria&lt;Blog&gt;()
  
.Add(Restrictions.Eq("Title", "Ayende @ Rahien"))
  
.List();
  
  
var blogs = s.CreateProjection&lt;MyValueObject&gt;()
  
.StartingWith&lt;Blog&gt;()
  
.Add(Restrictions.Eq("Title", "Ayende @ Rahien"))
  
.List();
</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment9</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment9</guid><pubDate>Tue, 26 May 2009 14:57:01 GMT</pubDate></item><item><title>Jason Meckley commented on NHibernate: Why do we need to specify the query type twice?</title><description>new API?
  
  
var blogs = s.CreateCriteria
&lt;blog()
  
    .Add(Restrictions.Eq("Title", "Ayende @ Rahien"))
  
    .List();
  
  
var blogs = s.CreateProjection
&lt;myvalueobject()
  
    .StartingWith
&lt;blog()
  
    .Add(Restrictions.Eq("Title", "Ayende @ Rahien"))
  
    .List();
  
  
I know, I know... patch :)
&gt;</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment8</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment8</guid><pubDate>Tue, 26 May 2009 14:53:31 GMT</pubDate></item><item><title>Josh N commented on NHibernate: Why do we need to specify the query type twice?</title><description>code got mangled, here it is again:
  
  
public class Foo
&lt;t {
  
  public T List() {
  
    return List
&lt;t();
  
  }
  
  public B List
****() {
  
    ...
  
  }
  
}
&gt;</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment7</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment7</guid><pubDate>Tue, 26 May 2009 03:22:46 GMT</pubDate></item><item><title>Josh N commented on NHibernate: Why do we need to specify the query type twice?</title><description>why not have 2 implementation of the List() function. One that is function type parameterized and one that is class type parameterized?
  
  
	public class Foo
&lt;t	 {
  
	  public T List() {
  
	    return List
&lt;t	();
  
	  }
  
	  public B List
****	() {
  
	    ...
  
	  }
  
	}
  
&gt;</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment6</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment6</guid><pubDate>Tue, 26 May 2009 03:21:43 GMT</pubDate></item><item><title>Andrey Shchekin commented on NHibernate: Why do we need to specify the query type twice?</title><description>Well, why not Criteria&lt;T&gt; with SetProjection changing T?
</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment5</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment5</guid><pubDate>Mon, 25 May 2009 23:41:46 GMT</pubDate></item><item><title>Andrey Shchekin commented on NHibernate: Why do we need to specify the query type twice?</title><description>Well, why not Criteria
&lt;t with SetProjection changing T?
&gt;</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment4</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment4</guid><pubDate>Mon, 25 May 2009 23:41:11 GMT</pubDate></item><item><title>Shawn Wildermuth commented on NHibernate: Why do we need to specify the query type twice?</title><description>It is also useful in polymorphic situations.
</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment3</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment3</guid><pubDate>Mon, 25 May 2009 22:46:39 GMT</pubDate></item><item><title>JW commented on NHibernate: Why do we need to specify the query type twice?</title><description>duh.
</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment2</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment2</guid><pubDate>Mon, 25 May 2009 19:24:36 GMT</pubDate></item><item><title>Krzysztof Kozmic commented on NHibernate: Why do we need to specify the query type twice?</title><description>This could be "fixed" by using strongly typed criteria (with lambdas and stuff) in 80% of cases.
</description><link>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment1</link><guid>http://ayende.com/4034/nhibernate-why-do-we-need-to-specify-the-query-type-twice#comment1</guid><pubDate>Mon, 25 May 2009 19:16:53 GMT</pubDate></item></channel></rss>