|
From: <ric...@us...> - 2009-07-02 21:59:56
|
Revision: 4564
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4564&view=rev
Author: ricbrown
Date: 2009-07-02 21:59:53 +0000 (Thu, 02 Jul 2009)
Log Message:
-----------
Implemented IQueryOver interface explicitly to maintain type on fluent methods.
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs
trunk/nhibernate/src/NHibernate/IQueryOver.cs
trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs
Modified: trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs 2009-07-02 21:24:11 UTC (rev 4563)
+++ trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs 2009-07-02 21:59:53 UTC (rev 4564)
@@ -42,41 +42,41 @@
get { return _criteria; }
}
- public IQueryOver<T> And(Expression<Func<T, bool>> expression)
+ public QueryOver<T> And(Expression<Func<T, bool>> expression)
{
return Add(expression);
}
- public IQueryOver<T> And(Expression<Func<bool>> expression)
+ public QueryOver<T> And(Expression<Func<bool>> expression)
{
return Add(expression);
}
- public IQueryOver<T> Where(Expression<Func<T, bool>> expression)
+ public QueryOver<T> Where(Expression<Func<T, bool>> expression)
{
return Add(expression);
}
- public IQueryOver<T> Where(Expression<Func<bool>> expression)
+ public QueryOver<T> Where(Expression<Func<bool>> expression)
{
return Add(expression);
}
- public IQueryOver<U> JoinQueryOver<U>(Expression<Func<T, U>> path)
+ public QueryOver<U> JoinQueryOver<U>(Expression<Func<T, U>> path)
{
return new QueryOver<U>(_impl,
_criteria.CreateCriteria(
ExpressionProcessor.FindMemberExpression(path.Body)));
}
- public IQueryOver<U> JoinQueryOver<U>(Expression<Func<T, IEnumerable<U>>> path)
+ public QueryOver<U> JoinQueryOver<U>(Expression<Func<T, IEnumerable<U>>> path)
{
return new QueryOver<U>(_impl,
_criteria.CreateCriteria(
ExpressionProcessor.FindMemberExpression(path.Body)));
}
- public IQueryOver<T> Join(Expression<Func<T, object>> path, Expression<Func<object>> alias)
+ public QueryOver<T> Join(Expression<Func<T, object>> path, Expression<Func<object>> alias)
{
return AddAlias(
ExpressionProcessor.FindMemberExpression(path.Body),
@@ -89,6 +89,9 @@
return _criteria.List<T>();
}
+ /// <summary>
+ /// Get an executable instance of <c>IQueryOver<T></c>,
+ /// to actually run the query.</summary>
public IQueryOver<T> GetExecutableQueryOver(ISession session)
{
_impl.Session = session.GetSessionImplementation();
@@ -113,6 +116,28 @@
return this;
}
+
+ IQueryOver<T> IQueryOver<T>.And(Expression<Func<T, bool>> expression)
+ { return And(expression); }
+
+ IQueryOver<T> IQueryOver<T>.And(Expression<Func<bool>> expression)
+ { return And(expression); }
+
+ IQueryOver<T> IQueryOver<T>.Where(Expression<Func<T, bool>> expression)
+ { return Where(expression); }
+
+ IQueryOver<T> IQueryOver<T>.Where(Expression<Func<bool>> expression)
+ { return Where(expression); }
+
+ IQueryOver<U> IQueryOver<T>.JoinQueryOver<U>(Expression<Func<T, U>> path)
+ { return JoinQueryOver(path); }
+
+ IQueryOver<U> IQueryOver<T>.JoinQueryOver<U>(Expression<Func<T, IEnumerable<U>>> path)
+ { return JoinQueryOver(path); }
+
+ IQueryOver<T> IQueryOver<T>.Join(Expression<Func<T, object>> path, Expression<Func<object>> alias)
+ { return Join(path, alias); }
+
}
}
Modified: trunk/nhibernate/src/NHibernate/IQueryOver.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/IQueryOver.cs 2009-07-02 21:24:11 UTC (rev 4563)
+++ trunk/nhibernate/src/NHibernate/IQueryOver.cs 2009-07-02 21:59:53 UTC (rev 4564)
@@ -80,11 +80,6 @@
/// <returns>The list filled with the results.</returns>
IList<T> List();
- /// <summary>
- /// Get an executable instance of <c>Criteria<T></c>,
- /// to actually run the query.</summary>
- IQueryOver<T> GetExecutableQueryOver(ISession session);
-
}
}
Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-07-02 21:24:11 UTC (rev 4563)
+++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2009-07-02 21:59:53 UTC (rev 4564)
@@ -79,7 +79,7 @@
using (ISession s = OpenSession())
{
- var personQuery =
+ QueryOver<Person> personQuery =
new QueryOver<Person>()
.Where(p => p.Name == "test person 1");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|