src/Shared/EntityFramework/Core/Common/EntitySql/TypeResolver.cs
// <summary>
// Declares inline function in the query local metadata.
// </summary>
Declares inline function in the query local metadata.
Declares inline function in the query local metadata .
internal void DeclareInlineFunction(string name, InlineFunctionInfo functionInfo)
        {
            DebugCheck.NotEmpty(name);
            DebugCheck.NotNull(functionInfo);
            List<InlineFunctionInfo> overloads;
            if (!_functionDefinitions.TryGetValue(name, out overloads))
            {
                overloads = new List<InlineFunctionInfo>();
                _functionDefinitions.Add(name, overloads);
            }
             Check overload uniqueness.
            if (overloads.Exists(
                overload =>
                overload.Parameters.Select(p => p.ResultType).SequenceEqual(
                    functionInfo.Parameters.Select(p => p.ResultType), TypeUsageStructuralComparer.Instance)))
            {
                var errCtx = functionInfo.FunctionDefAst.ErrCtx;
                var message = Strings.DuplicatedInlineFunctionOverload(name);
                throw EntitySqlException.Create(errCtx, message, null);
            }
            overloads.Add(functionInfo);
        }
internal void DeclareInlineFunction ( string name , InlineFunctionInfo functionInfo ) { DebugCheck . NotEmpty ( name ) ; DebugCheck . NotNull ( functionInfo ) ; List < InlineFunctionInfo > overloads ; if ( ! _functionDefinitions . TryGetValue ( name , out overloads ) ) { overloads = new List < InlineFunctionInfo > ( ) ; _functionDefinitions . Add ( name , overloads ) ; } if ( overloads . Exists ( overload => overload . Parameters . Select ( p => p . ResultType ) . SequenceEqual ( functionInfo . Parameters . Select ( p => p . ResultType ) , TypeUsageStructuralComparer . Instance ) ) ) { var errCtx = functionInfo . FunctionDefAst . ErrCtx ; var message = Strings . DuplicatedInlineFunctionOverload ( name ) ; throw EntitySqlException . Create ( errCtx , message , null ) ; } overloads . Add ( functionInfo ) ; }
Declares inline function in the query local metadata.
Declares inline function in the query local metadata .
// // Check overload uniqueness. //
name
string
functionInfo
InlineFunctionInfo