Table of Contents

Class OrderDebuggingInfo

Namespace
Dynamicweb.Ecommerce.Orders
Assembly
Dynamicweb.Ecommerce.dll

Represents information about debugging.

public class OrderDebuggingInfo
Inheritance
OrderDebuggingInfo
Inherited Members

Examples

using System.Globalization;
using Dynamicweb.Ecommerce.Orders;

namespace Dynamicweb.Ecommerce.Examples.Orders;

public sealed class OrderLoggerSample
{
    public static void LogEvent(Order order, string message, params object[] @params)
    {
        string? orderId = null;
        if (string.IsNullOrEmpty(order?.Id))        
            orderId = "<No order>";        
        else        
            orderId = order.Id;

        string printedMessage = $"Order {orderId}: {string.Format(CultureInfo.InvariantCulture, message, @params)}";

        //save debugging info on the order
        if (order is not null)
        {
            var info = new OrderDebuggingInfo(order, printedMessage, "CheckoutHandler");
            Services.OrderDebuggingInfos.Save(info);
        }
    }
}

Constructors

OrderDebuggingInfo(Order, string, string)

Initializes a new instance of OrderDebuggingInfo.

[SetsRequiredMembers]
public OrderDebuggingInfo(Order order, string message, string source)

Parameters

order Order
message string
source string

OrderDebuggingInfo(Order, string, string, DebuggingInfoType)

Initializes a new instance of OrderDebuggingInfo.

[SetsRequiredMembers]
public OrderDebuggingInfo(Order order, string message, string source, DebuggingInfoType infoType)

Parameters

order Order
message string
source string
infoType DebuggingInfoType

Properties

InfoType

Gets the info type.

public DebuggingInfoType InfoType { get; set; }

Property Value

DebuggingInfoType

The info type.

Message

Gets the message.

public required string Message { get; set; }

Property Value

string

The message.

OrderAutoId

Gets order auto id.

public int? OrderAutoId { get; set; }

Property Value

int?

The order auto id.

OrderId

Gets order id.

public required string OrderId { get; set; }

Property Value

string

The order id.

Source

Gets the source.

public required string Source { get; set; }

Property Value

string

The info source.

Time

Gets time.

public required DateTime Time { get; set; }

Property Value

DateTime

The time.

To top