//--------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- namespace System.Data { using System; using System.Runtime.Serialization; using System.Security.Permissions; using System.Data.Objects; using System.Collections.ObjectModel; using System.Collections.Generic; /// /// Exception during save changes to store /// [Serializable] public class UpdateException : DataException { [NonSerialized] private ReadOnlyCollection _stateEntries; #region constructors /// /// Default constructor /// public UpdateException() : base() { } /// /// Constructor that takes a message /// /// public UpdateException(string message) : base(message) { } /// /// Constructor that takes a message and an inner exception /// /// /// public UpdateException(string message, Exception innerException) : base(message, innerException) { } /// /// Constructor that takes a message and an inner exception /// /// /// /// public UpdateException(string message, Exception innerException, IEnumerable stateEntries) : base(message, innerException) { List list = new List(stateEntries); _stateEntries = list.AsReadOnly(); } /// /// Gets state entries implicated in the error. /// public ReadOnlyCollection StateEntries { get { return _stateEntries; } } /// /// The protected constructor for serialization /// /// /// protected UpdateException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endregion } }