From: <fab...@us...> - 2010-09-22 20:25:16
|
Revision: 5202 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5202&view=rev Author: fabiomaulo Date: 2010-09-22 20:25:09 +0000 (Wed, 22 Sep 2010) Log Message: ----------- Fixed one of the two issues reported in NH-2206 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs Added Paths: ----------- trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessCast.cs Modified: trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs 2010-09-22 19:57:43 UTC (rev 5201) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs 2010-09-22 20:25:09 UTC (rev 5202) @@ -80,7 +80,8 @@ ResultOperatorMap.Add<FetchManyRequest, ProcessFetchMany>(); ResultOperatorMap.Add<CacheableResultOperator, ProcessCacheable>(); ResultOperatorMap.Add<OfTypeResultOperator, ProcessOfType>(); - } + ResultOperatorMap.Add<CastResultOperator, ProcessCast>(); + } private QueryModelVisitor(VisitorParameters visitorParameters, bool root, QueryModel queryModel) { Added: trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessCast.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessCast.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessCast.cs 2010-09-22 20:25:09 UTC (rev 5202) @@ -0,0 +1,16 @@ +using Remotion.Data.Linq.Clauses.ResultOperators; + +namespace NHibernate.Linq.Visitors.ResultOperatorProcessors +{ + public class ProcessCast : IResultOperatorProcessor<CastResultOperator> + { + public void Process(CastResultOperator resultOperator, QueryModelVisitor queryModelVisitor, IntermediateHqlTree tree) + { + // what we can do with Cast, so far, is only ignore it. + // The meaning of Cast<T>() is different than OfType<T>. + // With OfType<T> the user selects a specific entity-type; + // with Cast<T> the user "hopes" that everything will work with the same type + // When we will have some more detail we can change this "implementation" ;) + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-09-22 19:57:43 UTC (rev 5201) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-09-22 20:25:09 UTC (rev 5202) @@ -694,6 +694,7 @@ <Compile Include="Linq\ReWriters\RemoveUnnecessaryBodyOperators.cs" /> <Compile Include="Linq\Clauses\LeftJoinClause.cs" /> <Compile Include="Linq\IntermediateHqlTree.cs" /> + <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessCast.cs" /> <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessOfType.cs" /> <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessCacheable.cs" /> <Compile Include="Linq\Visitors\QuerySourceLocator.cs" /> @@ -1554,9 +1555,6 @@ <ItemGroup> <Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" /> </ItemGroup> - <ItemGroup> - <Folder Include="Cache\Access" /> - </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs 2010-09-22 19:57:43 UTC (rev 5201) +++ trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs 2010-09-22 20:25:09 UTC (rev 5202) @@ -430,7 +430,7 @@ Assert.AreEqual(2, query.Count); } - [Test(Description = "Reported as bug NH-2206"), Ignore("Not fixed yet")] + [Test(Description = "Reported as bug NH-2206")] public void SearchOnObjectTypeUpCastWithExtensionMethod() { var query = (from o in session.Query<Dog>() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |