DataServiceRequestException.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / DataServiceRequestException.cs / 1 / DataServiceRequestException.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//  
//      Exception class for batch requests and CUD operations.
//  
// 
// @owner  [....]
//--------------------------------------------------------------------- 

namespace System.Data.Services.Client
{
    using System; 

    ///  
    /// The exception that is thrown when executing a single query request. 
    /// 
#if !ASTORIA_LIGHT 
    [Serializable]
#endif
    [System.Diagnostics.DebuggerDisplay("{Message}")]
    public sealed class DataServiceRequestException : InvalidOperationException 
    {
        /// Actual response object. 
#if !ASTORIA_LIGHT 
        [NonSerialized]
#endif 
        private readonly DataServiceResponse response;

        #region Constructors.
 
        /// 
        /// Creates a new instance of DataServiceRequestException. 
        ///  
        public DataServiceRequestException()
            : base(Strings.DataServiceException_GeneralError) 
        {
        }

        ///  
        /// Creates a new instance of DataServiceRequestException.
        ///  
        /// error message for this exception. 
        public DataServiceRequestException(string message)
            : base(message) 
        {
        }

        ///  
        /// Creates a new instance of DataServiceRequestException.
        ///  
        /// error message for this exception. 
        /// Exception that caused this exception to be thrown.
        public DataServiceRequestException(string message, Exception innerException) 
            : base(message, innerException)
        {
        }
 
        /// 
        /// Creates a new instance of DataServiceRequestException. 
        ///  
        /// error message for this exception.
        /// Exception that caused this exception to be thrown. 
        /// response object for this exception.
        public DataServiceRequestException(string message, Exception innerException, DataServiceResponse response)
            : base(message, innerException)
        { 
            this.response = response;
        } 
 
#if !ASTORIA_LIGHT
#pragma warning disable 0628 
        /// 
        /// Initializes a new instance of the DataServiceQueryException class from the
        /// specified SerializationInfo and StreamingContext instances.
        ///  
        /// 
        /// A SerializationInfo containing the information required to serialize 
        /// the new DataServiceException. 
        /// 
        /// A StreamingContext containing the source of the serialized stream 
        /// associated with the new DataServiceException.
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1047", Justification = "Follows serialization info pattern.")]
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032", Justification = "Follows serialization info pattern.")]
        protected DataServiceRequestException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) 
            : base(info, context)
        { 
        } 
#pragma warning restore 0628
#endif 

        #endregion Constructors.

        #region Public properties. 

        /// Error code to be used in payloads. 
        public DataServiceResponse Response 
        {
            get { return this.response; } 
        }

        #endregion Public properties.
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//  
//      Exception class for batch requests and CUD operations.
//  
// 
// @owner  [....]
//--------------------------------------------------------------------- 

namespace System.Data.Services.Client
{
    using System; 

    ///  
    /// The exception that is thrown when executing a single query request. 
    /// 
#if !ASTORIA_LIGHT 
    [Serializable]
#endif
    [System.Diagnostics.DebuggerDisplay("{Message}")]
    public sealed class DataServiceRequestException : InvalidOperationException 
    {
        /// Actual response object. 
#if !ASTORIA_LIGHT 
        [NonSerialized]
#endif 
        private readonly DataServiceResponse response;

        #region Constructors.
 
        /// 
        /// Creates a new instance of DataServiceRequestException. 
        ///  
        public DataServiceRequestException()
            : base(Strings.DataServiceException_GeneralError) 
        {
        }

        ///  
        /// Creates a new instance of DataServiceRequestException.
        ///  
        /// error message for this exception. 
        public DataServiceRequestException(string message)
            : base(message) 
        {
        }

        ///  
        /// Creates a new instance of DataServiceRequestException.
        ///  
        /// error message for this exception. 
        /// Exception that caused this exception to be thrown.
        public DataServiceRequestException(string message, Exception innerException) 
            : base(message, innerException)
        {
        }
 
        /// 
        /// Creates a new instance of DataServiceRequestException. 
        ///  
        /// error message for this exception.
        /// Exception that caused this exception to be thrown. 
        /// response object for this exception.
        public DataServiceRequestException(string message, Exception innerException, DataServiceResponse response)
            : base(message, innerException)
        { 
            this.response = response;
        } 
 
#if !ASTORIA_LIGHT
#pragma warning disable 0628 
        /// 
        /// Initializes a new instance of the DataServiceQueryException class from the
        /// specified SerializationInfo and StreamingContext instances.
        ///  
        /// 
        /// A SerializationInfo containing the information required to serialize 
        /// the new DataServiceException. 
        /// 
        /// A StreamingContext containing the source of the serialized stream 
        /// associated with the new DataServiceException.
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1047", Justification = "Follows serialization info pattern.")]
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032", Justification = "Follows serialization info pattern.")]
        protected DataServiceRequestException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) 
            : base(info, context)
        { 
        } 
#pragma warning restore 0628
#endif 

        #endregion Constructors.

        #region Public properties. 

        /// Error code to be used in payloads. 
        public DataServiceResponse Response 
        {
            get { return this.response; } 
        }

        #endregion Public properties.
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK