Products
Get a filtered list of products
Code Block |
---|
language | c# |
---|
title | Retrieve first 25 products where the PartNo starts with 'a' |
---|
|
var IN_MainQueryRequest = new IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25 };
ServiceStack.QueryResponse<IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest);
foreach(IN_Main product in IN_MainQueryResponse.Results)
{
Console.WriteLine("Part '{0}', InventoryID '{1}'", product.PartNo, product.InventoryID);
} |
Code Block |
---|
language | c# |
---|
title | Retrieve next 25 products where the PartNo starts with 'a' |
---|
|
var IN_MainQueryRequest = new IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25, Skip = 25 };
ServiceStack.QueryResponse<IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest);
foreach(IN_Main product in IN_MainQueryResponse.Results)
{
Console.WriteLine("Part '{0}', InventoryID '{1}'", product.PartNo, product.InventoryID);
} |
Read a product
In order to read a product, the InventoryID must be provided.
Code Block |
---|
language | c# |
---|
title | Read a product |
---|
|
var inventoryGETRequest = new InventoryGETRequest() { InventoryID = "000000000K00000000BQ" };
var inventoryItem = client.Get(inventoryGETRequest);
Console.WriteLine("Part '{0}', InventoryID '{1}'", inventoryItem.PartNo, inventoryItem.InventoryID);
|
Create a new product
Update an existing product
Delete a product