Class DuplicateNotAllowedException

An exception thrown when an operation attempts to create a duplicate in a collection with set semantics (IExtensible<T>.AllowsDuplicates is false) or attempts to create a duplicate key in a dictionary.

With collections this can only happen with Insert operations on lists, since the Add operations will not try to create duplictes and either ignore the failure or report it in a bool return value.

With dictionaries this can happen with the IDictionary<K,V>.Add(K key, V val) metod.

Implements

System.Runtime.Serialization.ISerializable, System.Runtime.InteropServices._Exception

Bases

object, System.Exception

Property overview

Data, Inherited from System.Exception ,
HelpLink, Inherited from System.Exception ,
HResult, Inherited from System.Exception ,
InnerException, Inherited from System.Exception ,
IsTransient, Inherited from System.Exception ,
Message, Inherited from System.Exception ,
Source, Inherited from System.Exception ,
StackTrace, Inherited from System.Exception ,
TargetSite, Inherited from System.Exception

Constructor overview

DuplicateNotAllowedException() ,
DuplicateNotAllowedException(string message)

Method overview

Equals(object obj), Inherited from object ,
Finalize(), Inherited from object ,
GetBaseException(), Inherited from System.Exception ,
GetHashCode(), Inherited from object ,
GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context), Inherited from System.Exception ,
GetType(), Inherited from System.Exception ,
GetType(), Inherited from object ,
MemberwiseClone(), Inherited from object ,
ToString(), Inherited from System.Exception

Constructor details

DuplicateNotAllowedException() Create a simple exception with no further explanation.
DuplicateNotAllowedException(string message) Create the exception with an explanation of the reason.
Parameters:
message: