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

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

ArgumentException with message like "Type must be System.Void for this label argument"
static private LabelTypeMustBeVoid ( string paramName ) : Exception
paramName string
Результат System.Exception
        internal static Exception LabelTypeMustBeVoid(string paramName)
        {
            return new ArgumentException(Strings.LabelTypeMustBeVoid, paramName);
        }
        /// <summary>

Usage Example

Пример #1
0
 /// <summary>
 /// Creates a <see cref="LoopExpression"/> with the given body.
 /// </summary>
 /// <param name="body">The body of the loop.</param>
 /// <param name="break">The break target used by the loop body.</param>
 /// <param name="continue">The continue target used by the loop body.</param>
 /// <returns>The created <see cref="LoopExpression"/>.</returns>
 public static LoopExpression Loop(Expression body, LabelTarget @break, LabelTarget @continue)
 {
     RequiresCanRead(body, nameof(body));
     if (@continue != null && @continue.Type != typeof(void))
     {
         throw Error.LabelTypeMustBeVoid();
     }
     return(new LoopExpression(body, @break, @continue));
 }
All Usage Examples Of System.Linq.Expressions.Error::LabelTypeMustBeVoid
Error