Remotion.Linq.SqlBackend.SqlPreparation.SqlPreparationQueryModelVisitor.GetConstantCollectionValue C# (CSharp) Method

GetConstantCollectionValue() private method

private GetConstantCollectionValue ( QueryModel queryModel ) : ICollection
queryModel QueryModel
return ICollection
    private ICollection GetConstantCollectionValue (QueryModel queryModel)
    {
      var fromExpressionAsConstant = (queryModel.MainFromClause.FromExpression) as ConstantExpression;
      if (queryModel.IsIdentityQuery () && fromExpressionAsConstant != null)
      {
        if (fromExpressionAsConstant.Value is ICollection)
          return (ICollection) fromExpressionAsConstant.Value;
        
        if (fromExpressionAsConstant.Value == null)
          throw new NotSupportedException ("Data sources cannot be null.");
      }

      return null;
    }
  }