|
From: <ste...@us...> - 2010-03-17 12:41:52
|
Revision: 4957
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4957&view=rev
Author: steverstrong
Date: 2010-03-17 12:41:45 +0000 (Wed, 17 Mar 2010)
Log Message:
-----------
Tweaked EagerFetching extension methods so that a client no longer needs to reference re-linq
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Linq/EagerFetchingExtensionMethods.cs
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Modified: trunk/nhibernate/src/NHibernate/Linq/EagerFetchingExtensionMethods.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Linq/EagerFetchingExtensionMethods.cs 2010-03-15 16:06:07 UTC (rev 4956)
+++ trunk/nhibernate/src/NHibernate/Linq/EagerFetchingExtensionMethods.cs 2010-03-17 12:41:45 UTC (rev 4957)
@@ -3,14 +3,14 @@
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
-using Remotion.Data.Linq.EagerFetching;
+using Remotion.Data.Linq;
using Remotion.Data.Linq.Utilities;
namespace NHibernate.Linq
{
public static class EagerFetchingExtensionMethods
{
- public static FluentFetchRequest<TOriginating, TRelated> Fetch<TOriginating, TRelated>(
+ public static INhFetchRequest<TOriginating, TRelated> Fetch<TOriginating, TRelated>(
this IQueryable<TOriginating> query, Expression<Func<TOriginating, TRelated>> relatedObjectSelector)
{
ArgumentUtility.CheckNotNull("query", query);
@@ -20,7 +20,7 @@
return CreateFluentFetchRequest<TOriginating, TRelated>(methodInfo, query, relatedObjectSelector);
}
- public static FluentFetchRequest<TOriginating, TRelated> FetchMany<TOriginating, TRelated>(
+ public static INhFetchRequest<TOriginating, TRelated> FetchMany<TOriginating, TRelated>(
this IQueryable<TOriginating> query, Expression<Func<TOriginating, IEnumerable<TRelated>>> relatedObjectSelector)
{
ArgumentUtility.CheckNotNull("query", query);
@@ -30,8 +30,8 @@
return CreateFluentFetchRequest<TOriginating, TRelated>(methodInfo, query, relatedObjectSelector);
}
- public static FluentFetchRequest<TQueried, TRelated> ThenFetch<TQueried, TFetch, TRelated>(
- this FluentFetchRequest<TQueried, TFetch> query, Expression<Func<TFetch, TRelated>> relatedObjectSelector)
+ public static INhFetchRequest<TQueried, TRelated> ThenFetch<TQueried, TFetch, TRelated>(
+ this INhFetchRequest<TQueried, TFetch> query, Expression<Func<TFetch, TRelated>> relatedObjectSelector)
{
ArgumentUtility.CheckNotNull("query", query);
ArgumentUtility.CheckNotNull("relatedObjectSelector", relatedObjectSelector);
@@ -40,8 +40,8 @@
return CreateFluentFetchRequest<TQueried, TRelated>(methodInfo, query, relatedObjectSelector);
}
- public static FluentFetchRequest<TQueried, TRelated> ThenFetchMany<TQueried, TFetch, TRelated>(
- this FluentFetchRequest<TQueried, TFetch> query, Expression<Func<TFetch, IEnumerable<TRelated>>> relatedObjectSelector)
+ public static INhFetchRequest<TQueried, TRelated> ThenFetchMany<TQueried, TFetch, TRelated>(
+ this INhFetchRequest<TQueried, TFetch> query, Expression<Func<TFetch, IEnumerable<TRelated>>> relatedObjectSelector)
{
ArgumentUtility.CheckNotNull("query", query);
ArgumentUtility.CheckNotNull("relatedObjectSelector", relatedObjectSelector);
@@ -50,14 +50,26 @@
return CreateFluentFetchRequest<TQueried, TRelated>(methodInfo, query, relatedObjectSelector);
}
- private static FluentFetchRequest<TOriginating, TRelated> CreateFluentFetchRequest<TOriginating, TRelated>(
+ private static INhFetchRequest<TOriginating, TRelated> CreateFluentFetchRequest<TOriginating, TRelated>(
MethodInfo currentFetchMethod,
IQueryable<TOriginating> query,
LambdaExpression relatedObjectSelector)
{
var queryProvider = query.Provider; // ArgumentUtility.CheckNotNullAndType<QueryProviderBase>("query.Provider", query.Provider);
var callExpression = Expression.Call(currentFetchMethod, query.Expression, relatedObjectSelector);
- return new FluentFetchRequest<TOriginating, TRelated>(queryProvider, callExpression);
+ return new NhFetchRequest<TOriginating, TRelated>(queryProvider, callExpression);
}
}
+
+ public interface INhFetchRequest<TQueried, TFetch> : IOrderedQueryable<TQueried>
+ {
+ }
+
+ public class NhFetchRequest<TQueried, TFetch> : QueryableBase<TQueried>, INhFetchRequest<TQueried, TFetch>
+ {
+ public NhFetchRequest(IQueryProvider provider, Expression expression)
+ : base(provider, expression)
+ {
+ }
+ }
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2010-03-15 16:06:07 UTC (rev 4956)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2010-03-17 12:41:45 UTC (rev 4957)
@@ -24,8 +24,7 @@
<include name="LinFu.DynamicProxy.dll" />
<include name="nunit.framework.dll" />
<include name="Antlr3.Runtime.dll" />
- <include name="Remotion.Data.Linq.dll" />
- <include name="System.Linq.Dynamic.dll" />
+ <include name="System.Linq.Dynamic.dll" />
</assemblyfileset>
<resourcefileset id="project.resources" prefix="NHibernate.Test" dynamicprefix="true">
<include name="**/*.xml" />
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-03-15 16:06:07 UTC (rev 4956)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-03-17 12:41:45 UTC (rev 4957)
@@ -62,10 +62,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\net\3.5\nunit.framework.dll</HintPath>
</Reference>
- <Reference Include="Remotion.Data.Linq, Version=1.13.9.2, Culture=neutral, PublicKeyToken=cab60358ab4081ea, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\net\3.5\Remotion.Data.Linq.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|