Class StoreService
Inheritance
Implements
Namespace: DirectScale.Disco.Extension.Services
Assembly: DirectScale.Disco.Extension.Abstractions.dll
Syntax
public class StoreService : Object, IStoreService
Constructors
StoreService(IApiService)
Declaration
public StoreService(IApiService apiService)
Parameters
Type | Name | Description |
---|---|---|
IApiService | apiService |
Methods
CreateStore(Store)
Creates a new Custom store
.
Declaration
public Task<Store> CreateStore(Store store)
Parameters
Type | Name | Description |
---|---|---|
Store | store | New store. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Store> | Same object, but with Id populated. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Null value supplied. |
System.ArgumentException | Store has no name or is not Custom. |
System.InvalidOperationException | No default store is set or |
See Also
DeleteStore(Int32)
Deletes the storeId
record, if it exists.
Declaration
public Task DeleteStore(int storeId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | storeId | The store's DB recordnumber. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Remarks
Does nothing if storeId
doesn't exist.
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Invalid |
GetStore(Int32)
Gets the storeId
record.
Declaration
public Task<Store> GetStore(int storeId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | storeId | The store's DB recordnumber. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Store> | The store details for specified |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Invalid |
System.InvalidOperationException | No store found for |
See Also
GetStoreByType(StoreType)
Gets the store used for specified storeType
.
Declaration
public Task<Store> GetStoreByType(StoreType storeType)
Parameters
Type | Name | Description |
---|---|---|
StoreType | storeType | The type to get. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Store> | The store details for specified |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.InvalidOperationException | If no store is configured with specified |
See Also
GetStores()
Gets all store details set up.
Declaration
public Task<Store[]> GetStores()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Store[]> | Array of Stores. |
See Also
UpdateStore(Store)
Modify an existing store record.
Declaration
public Task<Store> UpdateStore(Store store)
Parameters
Type | Name | Description |
---|---|---|
Store | store | Store to modify. Type cannot be changed. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Store> |
|
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Null value supplied. |
System.ArgumentOutOfRangeException | Invalid Id. |
System.ArgumentException | Store has no name. |
System.InvalidOperationException | No default store is set or |