44using System . Linq . Expressions ;
55using System . Reflection ;
66using Remotion . Linq ;
7- using Remotion . Linq . Utilities ;
87
98namespace NHibernate . Linq
109{
@@ -13,8 +12,8 @@ public static class EagerFetchingExtensionMethods
1312 public static INhFetchRequest < TOriginating , TRelated > Fetch < TOriginating , TRelated > (
1413 this IQueryable < TOriginating > query , Expression < Func < TOriginating , TRelated > > relatedObjectSelector )
1514 {
16- ArgumentUtility . CheckNotNull ( " query" , query ) ;
17- ArgumentUtility . CheckNotNull ( " relatedObjectSelector" , relatedObjectSelector ) ;
15+ if ( query == null ) throw new ArgumentNullException ( nameof ( query ) ) ;
16+ if ( relatedObjectSelector == null ) throw new ArgumentNullException ( nameof ( relatedObjectSelector ) ) ;
1817
1918 var methodInfo = ( ( MethodInfo ) MethodBase . GetCurrentMethod ( ) ) . MakeGenericMethod ( typeof ( TOriginating ) , typeof ( TRelated ) ) ;
2019 return CreateFluentFetchRequest < TOriginating , TRelated > ( methodInfo , query , relatedObjectSelector ) ;
@@ -23,8 +22,8 @@ public static INhFetchRequest<TOriginating, TRelated> Fetch<TOriginating, TRelat
2322 public static INhFetchRequest < TOriginating , TRelated > FetchMany < TOriginating , TRelated > (
2423 this IQueryable < TOriginating > query , Expression < Func < TOriginating , IEnumerable < TRelated > > > relatedObjectSelector )
2524 {
26- ArgumentUtility . CheckNotNull ( " query" , query ) ;
27- ArgumentUtility . CheckNotNull ( " relatedObjectSelector" , relatedObjectSelector ) ;
25+ if ( query == null ) throw new ArgumentNullException ( nameof ( query ) ) ;
26+ if ( relatedObjectSelector == null ) throw new ArgumentNullException ( nameof ( relatedObjectSelector ) ) ;
2827
2928 var methodInfo = ( ( MethodInfo ) MethodBase . GetCurrentMethod ( ) ) . MakeGenericMethod ( typeof ( TOriginating ) , typeof ( TRelated ) ) ;
3029 return CreateFluentFetchRequest < TOriginating , TRelated > ( methodInfo , query , relatedObjectSelector ) ;
@@ -33,8 +32,8 @@ public static INhFetchRequest<TOriginating, TRelated> FetchMany<TOriginating, TR
3332 public static INhFetchRequest < TQueried , TRelated > ThenFetch < TQueried , TFetch , TRelated > (
3433 this INhFetchRequest < TQueried , TFetch > query , Expression < Func < TFetch , TRelated > > relatedObjectSelector )
3534 {
36- ArgumentUtility . CheckNotNull ( " query" , query ) ;
37- ArgumentUtility . CheckNotNull ( " relatedObjectSelector" , relatedObjectSelector ) ;
35+ if ( query == null ) throw new ArgumentNullException ( nameof ( query ) ) ;
36+ if ( relatedObjectSelector == null ) throw new ArgumentNullException ( nameof ( relatedObjectSelector ) ) ;
3837
3938 var methodInfo = ( ( MethodInfo ) MethodBase . GetCurrentMethod ( ) ) . MakeGenericMethod ( typeof ( TQueried ) , typeof ( TFetch ) , typeof ( TRelated ) ) ;
4039 return CreateFluentFetchRequest < TQueried , TRelated > ( methodInfo , query , relatedObjectSelector ) ;
@@ -43,8 +42,8 @@ public static INhFetchRequest<TQueried, TRelated> ThenFetch<TQueried, TFetch, TR
4342 public static INhFetchRequest < TQueried , TRelated > ThenFetchMany < TQueried , TFetch , TRelated > (
4443 this INhFetchRequest < TQueried , TFetch > query , Expression < Func < TFetch , IEnumerable < TRelated > > > relatedObjectSelector )
4544 {
46- ArgumentUtility . CheckNotNull ( " query" , query ) ;
47- ArgumentUtility . CheckNotNull ( " relatedObjectSelector" , relatedObjectSelector ) ;
45+ if ( query == null ) throw new ArgumentNullException ( nameof ( query ) ) ;
46+ if ( relatedObjectSelector == null ) throw new ArgumentNullException ( nameof ( relatedObjectSelector ) ) ;
4847
4948 var methodInfo = ( ( MethodInfo ) MethodBase . GetCurrentMethod ( ) ) . MakeGenericMethod ( typeof ( TQueried ) , typeof ( TFetch ) , typeof ( TRelated ) ) ;
5049 return CreateFluentFetchRequest < TQueried , TRelated > ( methodInfo , query , relatedObjectSelector ) ;
0 commit comments