Take the tour ×  enter image description here  In the image
above, you can see a warning from Code Contracts. I don't think
this is legit, as this can never be null.  Is this a bug or am I
missing something?  This property is a member of the following
class:  public class NHibernateIQueryableQueryBase<TEntity,
TQuery, TQueryInterface>     : IQuery<TEntity>,
IFluentQueryInterface<TEntity, TQueryInterface>     where TQuery
: NHibernateIQueryableQueryBase<TEntity, TQuery,     where
TQueryInterface : IQuery<TEntity>  Changing the property to the
following still shows the warning - on the line return result;:
public TQueryInterface And         var result = this as TQuery;
return result; share|improve this question Complete shot in the
dark cause I am a noob and I'm sure you've thought of it but
couldn't the cast of TQuery(this) return null? –  Jesse Carter
Nov 7 '12 at 16:39 Please show us your type declaration. What
constraints do you have on those generic parameters? –  SLaks
Nov 7 '12 at 16:45 @JesseCa