Example #1
0
 /// <summary>
 ///     Creates a new instance of the <see cref="TableValuedFunctionExpression" /> class.
 /// </summary>
 /// <param name="storeFunction">The <see cref="IStoreFunction" /> associated this function.</param>
 /// <param name="arguments">The arguments of the function.</param>
 public TableValuedFunctionExpression(IStoreFunction storeFunction, IReadOnlyList <SqlExpression> arguments)
     : this(
         storeFunction.Name.Substring(0, 1).ToLowerInvariant(),
         storeFunction,
         arguments)
 {
 }
 public TableValuedFunctionExpression([NotNull] IStoreFunction storeFunction, [NotNull] IReadOnlyList <SqlExpression> arguments)
     : this(
         storeFunction.Name.Substring(0, 1).ToLowerInvariant(),
         Check.NotNull(storeFunction, nameof(storeFunction)),
         Check.NotNull(arguments, nameof(arguments)))
 {
 }
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 //Since this is always generated while compiling there is no query provider associated
 public TableValuedFunctionQueryRootExpression(
     IEntityType entityType,
     IStoreFunction function,
     IReadOnlyCollection <Expression> arguments)
     : base(entityType)
 {
     Function  = function;
     Arguments = arguments;
 }
        /// <summary>
        ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
        ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
        ///     any release. You should only use it directly in your code with extreme caution and knowing that
        ///     doing so can result in application failures when updating to a new Entity Framework Core release.
        /// </summary>
        //Since this is always generated while compiling there is no query provider associated
        public TableValuedFunctionQueryRootExpression(
            [NotNull] IEntityType entityType, [NotNull] IStoreFunction function, [NotNull] IReadOnlyCollection <Expression> arguments)
            : base(entityType)
        {
            Check.NotNull(function, nameof(function));
            Check.NotNull(arguments, nameof(arguments));

            Function  = function;
            Arguments = arguments;
        }
        /// <summary>
        ///     <para>
        ///         Creates a human-readable representation of the given metadata.
        ///     </para>
        ///     <para>
        ///         Warning: Do not rely on the format of the returned string.
        ///         It is designed for debugging only and may change arbitrarily between releases.
        ///     </para>
        /// </summary>
        /// <param name="function"> The metadata item. </param>
        /// <param name="options"> Options for generating the string. </param>
        /// <param name="indent"> The number of indent spaces to use before each new line. </param>
        /// <returns> A human-readable representation. </returns>
        public static string ToDebugString(
            [NotNull] this IStoreFunction function,
            MetadataDebugStringOptions options,
            int indent = 0)
        {
            var builder      = new StringBuilder();
            var indentString = new string(' ', indent);

            builder
            .Append(indentString)
            .Append("StoreFunction: ");

            if (function.ReturnType != null)
            {
                builder.Append(function.ReturnType);
            }
            else
            {
                builder.Append(function.EntityTypeMappings.FirstOrDefault()?.EntityType.DisplayName() ?? "");
            }

            builder.Append(" ");

            if (function.Schema != null)
            {
                builder
                .Append(function.Schema)
                .Append(".");
            }

            builder.Append(function.Name);

            if ((options & MetadataDebugStringOptions.SingleLine) == 0)
            {
                var parameters = function.Parameters.ToList();
                if (parameters.Count != 0)
                {
                    builder.AppendLine().Append(indentString).Append("  Parameters: ");
                    foreach (var parameter in parameters)
                    {
                        builder.AppendLine().Append(parameter.ToDebugString(options, indent + 4));
                    }
                }

                if ((options & MetadataDebugStringOptions.IncludeAnnotations) != 0)
                {
                    builder.Append(function.AnnotationsToDebugString(indent: indent + 2));
                }
            }

            return(builder.ToString());
        }
 /// <inheritdoc />
 public virtual IEnumerable <IAnnotation> For(IStoreFunction function, bool designTime)
 => Enumerable.Empty <IAnnotation>();
 private TableValuedFunctionExpression(string alias, IStoreFunction storeFunction, IReadOnlyList <SqlExpression> arguments)
     : base(alias)
 {
     StoreFunction = storeFunction;
     Arguments     = arguments;
 }
 /// <summary>
 ///     Creates a new instance of the <see cref="TableValuedFunctionExpression" /> class.
 /// </summary>
 /// <param name="storeFunction">The <see cref="IStoreFunction" /> associated this function.</param>
 /// <param name="arguments">The arguments of the function.</param>
 public TableValuedFunctionExpression(IStoreFunction storeFunction, IReadOnlyList <SqlExpression> arguments)
     : this(
Example #9
0
 private Expression CreateTableValuedFunctionQueryRootExpression(
     IStoreFunction function,
     IReadOnlyCollection <Expression> arguments)
 // See issue #19970
 => new TableValuedFunctionQueryRootExpression(function.EntityTypeMappings.Single().EntityType, function, arguments);
 public virtual IEnumerable <IAnnotation> For(IStoreFunction function)
 => Enumerable.Empty <IAnnotation>();
Example #11
0
 public IEnumerable <IAnnotation> For(IStoreFunction function) => _providers.SelectMany(p => p.For(function));
Example #12
0
 /// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public FunctionColumn([NotNull] string name, [NotNull] string type, [NotNull] IStoreFunction function)
 {
     Name      = name;
     StoreType = type;
     Function  = function;
 }