CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
DataPortalErrorInfo.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="HttpErrorInfo.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Message containing details about any</summary>
7//-----------------------------------------------------------------------
8
9using System;
10
12{
18 public class DataPortalErrorInfo : ReadOnlyBase<DataPortalErrorInfo>
19 {
23 public static readonly PropertyInfo<string> ExceptionTypeNameProperty = RegisterProperty<string>(c => c.ExceptionTypeName);
24
28 public string ExceptionTypeName
29 {
31 private set { LoadProperty(ExceptionTypeNameProperty, value); }
32 }
33
37 public static readonly PropertyInfo<string> MessageProperty = RegisterProperty<string>(c => c.Message);
38
42 public string Message
43 {
44 get { return GetProperty(MessageProperty); }
45 private set { LoadProperty(MessageProperty, value); }
46 }
47
51 public static readonly PropertyInfo<string> StackTraceProperty = RegisterProperty<string>(c => c.StackTrace);
52
56 public string StackTrace
57 {
58 get { return GetProperty(StackTraceProperty); }
59 private set { LoadProperty(StackTraceProperty, value); }
60 }
61
65 public static readonly PropertyInfo<string> SourceProperty = RegisterProperty<string>(c => c.Source);
66
70 public string Source
71 {
72 get { return GetProperty(SourceProperty); }
73 private set { LoadProperty(SourceProperty, value); }
74 }
75
79 public static readonly PropertyInfo<string> TargetSiteNameProperty = RegisterProperty<string>(c => c.TargetSiteName);
80
84 public string TargetSiteName
85 {
86 get { return GetProperty(TargetSiteNameProperty); }
87 private set { LoadProperty(TargetSiteNameProperty, value); }
88 }
89
95 public static readonly PropertyInfo<DataPortalErrorInfo> InnerErrorProperty = RegisterProperty<DataPortalErrorInfo>(c => c.InnerError);
96
103 {
104 get { return GetProperty(InnerErrorProperty); }
105 private set { LoadProperty(InnerErrorProperty, value); }
106 }
107
115 public DataPortalErrorInfo(ApplicationContext applicationContext, Exception ex)
116 {
117 ApplicationContext = applicationContext;
118 this.ExceptionTypeName = ex.GetType().FullName;
119 this.Message = ex.Message;
120 this.StackTrace = ex.StackTrace;
121 this.Source = ex.Source;
122 if (ex.InnerException != null)
124 }
125
130 { }
131 }
132}
Provides consistent context information between the client and server DataPortal objects.
object CreateInstance(Type objectType, params object[] parameters)
Creates an object using Activator.
Maintains metadata about a property.
This is a base class from which readonly business classes can be derived.
Definition: ReadOnlyBase.cs:55
virtual void LoadProperty(IPropertyInfo propertyInfo, object newValue)
Loads a property's managed field with the supplied value calling PropertyHasChanged if the value does...
object GetProperty(IPropertyInfo propertyInfo)
Gets a property's value as a specified type.
ApplicationContext ApplicationContext
Gets or sets the current ApplicationContext object.
Definition: ReadOnlyBase.cs:90
Message containing details about any server-side exception.
static readonly PropertyInfo< string > StackTraceProperty
Stack trace from the exception object.
static readonly PropertyInfo< string > TargetSiteNameProperty
TargetSiteName of the exception object.
static readonly PropertyInfo< DataPortalErrorInfo > InnerErrorProperty
HttpErrorInfo object containing information about any inner exception of the original exception.
static readonly PropertyInfo< string > MessageProperty
Message from the exception object.
static readonly PropertyInfo< string > ExceptionTypeNameProperty
Type name of the exception object.
DataPortalErrorInfo(ApplicationContext applicationContext, Exception ex)
Creates an instance of the type.
string ExceptionTypeName
Type name of the exception object.
string TargetSiteName
TargetSiteName of the exception object.
DataPortalErrorInfo()
Creates an empty instance of the type.
string Message
Message from the exception object.
static readonly PropertyInfo< string > SourceProperty
Source of the exception object.
DataPortalErrorInfo InnerError
HttpErrorInfo object containing information about any inner exception of the original exception.
string StackTrace
Stack trace from the exception object.
@ Serializable
Prevents updating or inserting until the transaction is complete.