Click or drag to resize

OperationServiceExtensionsAddOrderProductItem Method (IOperationService, Guid, Decimal, IProduct, IOrder, IOrderGuestItem, IProductSize, ICredentials, OrderItemCourse, NullableDecimal)

Adds assortment position to the guest in existing order. User must have rights to edit orders.

Namespace:  Resto.Front.Api.Extensions
Assembly:  Resto.Front.Api.V8 (in Resto.Front.Api.V8.dll)
Syntax
C#
public static IOrderProductItem AddOrderProductItem(
	this IOperationService operationService,
	Guid id,
	decimal amount,
	IProduct product,
	IOrder order,
	IOrderGuestItem guest,
	IProductSize size,
	ICredentials credentials,
	OrderItemCourse course = OrderItemCourse.Default,
	decimal? predefinedPrice = null
)

Parameters

operationService
Type: Resto.Front.ApiIOperationService
Operation service.
id
Type: SystemGuid
Unique identifier of the new item in the order. MUST be unique not only for the order, but for the whole system. Therefore it must be taken from some synchronization operation or generated with Guid.NewGuid()
amount
Type: SystemDecimal
For positions with weight: weight in defined measure unit. For positions without weight: amount of the position. Can be from 0.001 to 999.999
product
Type: Resto.Front.Api.Data.AssortmentIProduct
Assortment position. Must exist in iikoFront assortment.
order
Type: Resto.Front.Api.Data.OrdersIOrder
Order to which position will be added
guest
Type: Resto.Front.Api.Data.OrdersIOrderGuestItem
Guest to which position will be added
size
Type: Resto.Front.Api.Data.AssortmentIProductSize
Size of the order item if it's product has scale, otherwise null.
credentials
Type: Resto.Front.Api.Data.SecurityICredentials
Credentials of the user. Required to pass permission and some other checks, as well as execute personalized operations.
course (Optional)
Type: Resto.Front.Api.Data.OrdersOrderItemCourse
Cooking and serving priority of the order item.
predefinedPrice (Optional)
Type: SystemNullableDecimal
Predefined fixed price of the order item, allows to use external quotation instead of default price list. null means default price.

Return Value

Type: IOrderProductItem

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IOperationService. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also