Guides
These docs are for v1.13.1. Click to read the latest docs for v2.0.0.

OrderService

The Order service manages items that need to be shipped and fulfilled from a warehouse.

Instantiating

The OrderService is exposed through the MerchelloContext

var orderService = MerchelloContext.Current.Services.OrderService;

Class

public class OrderService : PageCachedServiceBase<IOrder>, 
	IOrderService, IPageCachedService<IOrder>, IService

Constructors

NameDescription
OrderService()Initializes a new instance of the OrderService class.
OrderService(ILogger)Initializes a new instance of the OrderService class.
OrderService(RepositoryFactory, ILogger, IStoreSettingService, IShipmentService)Initializes a new instance of the OrderService class.
OrderService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger, IStoreSettingService, IShipmentService)Initializes a new instance of the OrderService class.
OrderService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger, IStoreSettingService, IShipmentService)Initializes a new instance of the OrderService class.

Public Methods

NameDescription
CreateOrder(Guid, Guid, Boolean)Creates a IOrder without saving it to the database
CreateOrder(Guid, Guid, Int32, Boolean)Creates a IOrder without saving it to the database
CreateOrderWithKeyCreates a IOrder and saves it to the database
Delete(IOrder, Boolean)Deletes a single IOrder
Delete(IEnumerable(IOrder), Boolean)Deletes a collection IOrder
GetAllOrderStatusesReturns a collection of all IOrderStatus
GetByKeyGets a IOrder given it's unique 'key' (GUID)
GetByKeysGets list of IOrder objects given a list of Keys
GetByOrderNumberGets a IOrder given it's unique 'OrderNumber'
GetOrdersByInvoiceKeyGets a collection of IOrder for a given IInvoice key
GetOrderStatusByKeyGets an IOrderStatus by it's key
GetPage(Int64, Int64, String, SortDirection)Gets a Page of IOrder
Save(IOrder, Boolean)Saves a single IOrder
Save(IEnumerable(IOrder), Boolean)Saves a collection of IOrder

Events

NameDescription
CreatingOccurs before create
CreatedOccurs after create
DeletingOccurs before delete
DeletedOccurs after delete
SavingOccurs before save
SavedOccurs after save
StatusChangingOccurs before order status change
StatusChangedOccurs after order status change

Interface on GitHub

https://github.com/Merchello/Merchello/blob/master/src/Merchello.Core/Services/Interfaces/IOrderService.cs