Table of Contents

Class HttpPacketResult

Namespace
Tripous.Http
Assembly
Tripous.dll

Represents a JSON result packet returned by controller action methods.

public class HttpPacketResult
Inheritance
HttpPacketResult
Inherited Members
Extension Methods

Constructors

HttpPacketResult()

Constructor.

public HttpPacketResult()

Properties

Entity

Gets or sets an entity serialized along with this result as a whole.

public object Entity { get; set; }

Property Value

object

ErrorText

Gets or sets the error information, if any.

public string ErrorText { get; set; }

Property Value

string

IsSuccess

Gets or sets a value indicating whether the call succeeded business-logic-wise.

public bool IsSuccess { get; set; }

Property Value

bool

Packet

Gets or sets the JSON text packet returned to the caller.

public string Packet { get; set; }

Property Value

string

Methods

DeserializePacket<T>()

Deserializes the Packet property to an instance of a specified type.

public T DeserializePacket<T>()

Returns

T

Type Parameters

T

Error(string)

Creates and returns a failed result with an error message.

public static HttpPacketResult Error(string ErrorText)

Parameters

ErrorText string

Returns

HttpPacketResult

SerializePacket(object)

Serializes a specified instance and assigns the Packet property.

public void SerializePacket(object Packet)

Parameters

Packet object

SetEntity(object, bool)

Creates and returns a result with an entity serialized as part of the result object.

public static HttpPacketResult SetEntity(object Entity, bool IsSuccess = true)

Parameters

Entity object
IsSuccess bool

Returns

HttpPacketResult

SetPacket(object, bool)

Creates and returns a successful result with a serialized packet.

public static HttpPacketResult SetPacket(object Packet, bool IsSuccess = true)

Parameters

Packet object
IsSuccess bool

Returns

HttpPacketResult