コード例 #1
0
        public IQueryHandler <TResult> BuildHandler <TResult>(QueryStatistics statistics)
        {
            BuildDatabaseStatement(statistics);

            var handler = buildHandlerForCurrentStatement <TResult>();

            return(AllIncludes.Any()
                ? new IncludeQueryHandler <TResult>(handler, AllIncludes.Select(x => x.BuildReader(_session)).ToArray())
                : handler);
        }
コード例 #2
0
ファイル: LinqHandlerBuilder.cs プロジェクト: srasch/marten
        public IQueryHandler <TResult> BuildHandler <TResult>(QueryStatistics statistics)
        {
            try
            {
                BuildDatabaseStatement(statistics);

                var handler = buildHandlerForCurrentStatement <TResult>();

                return(AllIncludes.Any()
                    ? new IncludeQueryHandler <TResult>(handler, AllIncludes.Select(x => x.BuildReader(_session)).ToArray())
                    : handler);
            }
            catch (NotSupportedException e)
            {
                if (e.Message.StartsWith("Can't infer NpgsqlDbType for type"))
                {
                    throw new BadLinqExpressionException("Marten cannot support custom value types in Linq expression. Please query on either simple properties of the value type, or register a custom IFieldSource for this value type.", e);
                }

                throw;
            }
        }