1 //---------------------------------------------------------------------
2 // <copyright file="InternalMappingException.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
11 using System.Data.Common.Utils;
12 using System.Data.Mapping.ViewGeneration.Structures;
13 using System.Runtime.Serialization;
15 namespace System.Data {
18 /// Mapping exception class. Note that this class has state - so if you change even
19 /// its internals, it can be a breaking change
22 internal class InternalMappingException : EntityException {
23 // effects: constructor with default message
26 /// default constructor
28 internal InternalMappingException() // required ctor
34 /// default constructor
36 /// <param name="message">localized error message</param>
37 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] // required CTOR for exceptions.
38 internal InternalMappingException(string message) // required ctor
46 /// <param name="message">localized error message</param>
47 /// <param name="innerException">inner exception</param>
48 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] // required CTOR for exceptions.
49 internal InternalMappingException(string message, Exception innerException) // required ctor
50 : base(message, innerException)
57 /// <param name="info"></param>
58 /// <param name="context"></param>
59 protected InternalMappingException(SerializationInfo info, StreamingContext context) :
64 // effects: constructor that allows a log
65 internal InternalMappingException(string message, ErrorLog errorLog) : base(message) {
66 EntityUtil.CheckArgumentNull(errorLog, "errorLog");
67 m_errorLog = errorLog;
70 // effects: constructor that allows single mapping error
71 internal InternalMappingException(string message, ErrorLog.Record record)
73 EntityUtil.CheckArgumentNull(record, "record");
74 m_errorLog = new ErrorLog();
75 m_errorLog.AddEntry(record);
80 // Keep track of mapping errors that we want to give to the
82 private ErrorLog m_errorLog;
87 /// Returns the inner exceptions stored in this
89 internal ErrorLog ErrorLog {