Walter.BOM
NotImplementedByDesignException Constructor(String,Int32,String,String)
Example 
Walter.BOM Assembly > Walter.BOM Namespace > NotImplementedByDesignException Class > NotImplementedByDesignException Constructor : NotImplementedByDesignException Constructor(String,Int32,String,String)
The message that describes the error and the reason for the design choice.
The line number in the source file at which the exception is thrown. Automatically captured by the compiler.
The name of the member (method or property) that throws this exception. Automatically captured by the compiler.
The source file path of the caller. Automatically captured by the compiler.
Initializes a new instance of the NotImplementedByDesignException class with a specific message and auto-generated context information.
Syntax
public NotImplementedByDesignException( 
   string message,
   int line,
   string callerMemberName,
   string filePath
)

Parameters

message
The message that describes the error and the reason for the design choice.
line
The line number in the source file at which the exception is thrown. Automatically captured by the compiler.
callerMemberName
The name of the member (method or property) that throws this exception. Automatically captured by the compiler.
filePath
The source file path of the caller. Automatically captured by the compiler.
Example
This example demonstrating how to throw an exception within a switch expression. This sample involves a method that processes different command types and throws a NotImplementedByDesignException for commands that are not supported by design.
public class CommandProcessor
            {
            public enum CommandType
            {
            Start,
            Stop,
            Pause,
            Unsupported // This command is intentionally not supported
            }
            public void ProcessCommand(CommandType command, [CallerMemberName] string? callerMemberName = null, [CallerFilePath] string? filePath = null, [CallerLineNumber] int line = 0)
            {
            _ = command switch
            {
            CommandType.Start => HandleStartCommand(),
            CommandType.Stop => HandleStopCommand(),
            CommandType.Pause => HandlePauseCommand(),
            CommandType.Unsupported => throw new NotImplementedByDesignException($"The command '{nameof(CommandType.Unsupported)}' is not supported by design.", callerMemberName, filePath, line),
            _ => throw new ArgumentException($"Invalid command: {command}", nameof(command))
            };
            }
            private string HandleStartCommand() => "Started";
            private string HandleStopCommand() => "Stopped";
            private string HandlePauseCommand() => "Paused";
            }
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

NotImplementedByDesignException Class
NotImplementedByDesignException Members
Overload List