System.Linq.Expressions.Error.MethodBuilderDoesNotHaveTypeBuilder C# (CSharp) Метод

MethodBuilderDoesNotHaveTypeBuilder() статический приватный Метод

ArgumentException with message like "MethodBuilder does not have a valid TypeBuilder"
static private MethodBuilderDoesNotHaveTypeBuilder ( ) : Exception
Результат System.Exception
        internal static Exception MethodBuilderDoesNotHaveTypeBuilder()
        {
            return new ArgumentException(Strings.MethodBuilderDoesNotHaveTypeBuilder);
        }
#endif

Usage Example

Пример #1
0
        /// <summary>
        /// Compiles the lambda into a method definition.
        /// </summary>
        /// <param name="method">A <see cref="Emit.MethodBuilder"/> which will be used to hold the lambda's IL.</param>
        public void CompileToMethod(System.Reflection.Emit.MethodBuilder method)
        {
            ContractUtils.RequiresNotNull(method, nameof(method));
            ContractUtils.Requires(method.IsStatic, nameof(method));
            var type = method.DeclaringType.GetTypeInfo() as System.Reflection.Emit.TypeBuilder;

            if (type == null)
            {
                throw Error.MethodBuilderDoesNotHaveTypeBuilder();
            }

            Compiler.LambdaCompiler.Compile(this, method);
        }
Error