Class ApplicationResponse<T>
- Namespace
- Dynamicweb.Core
- Assembly
- Dynamicweb.Core.dll
The Generic ApplicationResponse class gives information about the result of a given application service operation.
[Serializable]
public class ApplicationResponse<T> : ISerializable
Type Parameters
T
The Generic Type that the Response handles
- Inheritance
-
ApplicationResponse<T>
- Implements
- Derived
- Inherited Members
Constructors
ApplicationResponse()
Initializes the Response class with a value indicating the success or failure of the operation returning the response
public ApplicationResponse()
Remarks
Initializes as succeded.
ApplicationResponse(bool)
Initializes the Response class with a value indicating the success or failure of the operation returning the response
public ApplicationResponse(bool succeeded)
Parameters
succeeded
boolA value indicating the success or failure of the operation returning the response
ApplicationResponse(bool, T?)
Initializes the Response class with a value indicating the success or failure of the operation returning the response, along with any relevant return data of the generic type T
public ApplicationResponse(bool succeeded, T? data)
Parameters
succeeded
boolA value indicating the success or failure of the operation returning the response
data
TThe data returned from the operation
ApplicationResponse(Exception)
Initializes a new instance of the Response class with an Exception indicating what went wrong in the operation returning the response
public ApplicationResponse(Exception exceptionData)
Parameters
exceptionData
ExceptionA Exception explaining why the operation failed
Exceptions
ApplicationResponse(Exception, T?)
Initializes a new instance of the Response class with an Exception indicating what went wrong in the operation returning the response
public ApplicationResponse(Exception exceptionData, T? data)
Parameters
exceptionData
ExceptionA Exception explaining why the operation failed
data
TThe data returned from the operation
Exceptions
ApplicationResponse(SerializationInfo, StreamingContext)
Initializes a new instance of the ApplicationResponse<T> class.
protected ApplicationResponse(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe information.
context
StreamingContextThe context.
Properties
Data
Gets the data associated with the result of the operation returning the response
public T? Data { get; init; }
Property Value
- T
ExceptionData
Gets any exception data associated with a non successful response
public Exception? ExceptionData { get; init; }
Property Value
Message
Gets the message explaining why the operation failed
public string? Message { get; set; }
Property Value
Succeeded
Gets a value indicating the success or failure of the operation
public bool Succeeded { get; init; }
Property Value
Methods
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe SerializationInfo to populate with data.
context
StreamingContextThe destination (see StreamingContext) for this serialization.