Welcome to mirror list, hosted at ThFree Co, Russian Federation.

UpdateException.cs « Data « System « System.Data.Entity « referencesource « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7a1698868fb9058278ae41bf063ad329037ca6f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//---------------------------------------------------------------------
// <copyright file="UpdateException.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//
// @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;

    /// <summary>
    /// Exception during save changes to store
    /// </summary>
    [Serializable]
    public class UpdateException : DataException
    {
        [NonSerialized]
        private ReadOnlyCollection<ObjectStateEntry> _stateEntries;
            
    
        #region constructors
        /// <summary>
        /// Default constructor
        /// </summary>
        public UpdateException() 
            : base() 
        {
        }

        /// <summary>
        /// Constructor that takes a message
        /// </summary>
        /// <param name="message"></param>
        public UpdateException(string message) 
            : base(message) 
        {
        }

        /// <summary>
        /// Constructor that takes a message and an inner exception
        /// </summary>
        /// <param name="message"></param>
        /// <param name="innerException"></param>
        public UpdateException(string message, Exception innerException) 
            : base(message, innerException) 
        {
        }

        /// <summary>
        /// Constructor that takes a message and an inner exception
        /// </summary>
        /// <param name="message"></param>
        /// <param name="innerException"></param>
        /// <param name="stateEntries"></param>
        public UpdateException(string message, Exception innerException, IEnumerable<ObjectStateEntry> stateEntries)
            : base(message, innerException)
        {
            List<ObjectStateEntry> list = new List<ObjectStateEntry>(stateEntries); 
            _stateEntries = list.AsReadOnly();
        }

        /// <summary>
        /// Gets state entries implicated in the error.
        /// </summary>
        public ReadOnlyCollection<ObjectStateEntry> StateEntries { get { return _stateEntries; } }

        /// <summary>
        /// The protected constructor for serialization
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected UpdateException(SerializationInfo info, StreamingContext context)
            : base(info, context) 
        {
        }

        #endregion
     }
}