C# Class Unipluss.TransactionService.DAL.TransactionRepository

Inheritance: ITransactionRepository
显示文件 Open project: unipluss/invoicetransactions Class Usage Examples

Protected Properties

Property Type Description
tableRequestOptions Microsoft.WindowsAzure.Storage.Table.TableRequestOptions

Private Properties

Property Type Description
AddReIndexRequestIfNeeded void
EnsureTransactionHasCustomerInternalID void
SerializeTransactionAndAddToQueue void

Public Methods

Method Description
AddOrUpdateTransaction ( Transaction t ) : void

Adds new transaction to table storage or updates an existing item. Throws exception when item is not valid, resolving customer external ID failed or if table storage operation fails.

AddOrUpdateTransaction ( TransactionTableEntity ent ) : void

Inserts or updates (using merge operation) the transaction table entity.

AddOrUpdateTransactionBatch ( IEnumerable batch ) : void

Inserts or updates (using merge operation) a batch of transaction table entities. Also generates IDs for items that do not have them and sets Date to DateTime.Now if it is null.

AddOrUpdateTransactionTotalsItem ( ) : void
AddReIndexableItemBatch ( ) : void
AddTransactionBatchToUpdateQueue ( IEnumerable batch ) : IEnumerable

Adds a batch of transaction items to WebJob queues. Workers process each queue item and add them to transaction table and search index. Can also be used for updating existing items if Transaction.ID is specified. Also generates IDs for items that do not have them and sets Date to DateTime.Now if it is null.

AddTransactionToUpdateQueue ( Transaction t ) : Transaction

Adds the transaction item to WebJob queues. Workers process each queue item and add them to transaction table and search index. Can also be used for updating existing items if Transaction.ID is specified. Also generates ID if it's null and sets Date to DateTime.Now if it isn't set.

DeleteReIndexItemBatch ( ) : void
DeleteTransaction ( int mvanumber, System.Guid id ) : void

Deletes transaction table storage entity that matches the mva number and ID. Throws exception when a entity is found with given ID but entity's mva number does not match with the one given as input.

DeleteTransactionTotalsItemWithID ( ) : void
EnsureStorageCreated ( ) : System.Threading.Tasks.Task
GetReIndexableItemBatch ( Microsoft.WindowsAzure.Storage.Table.TableContinuationToken &token ) : IEnumerable
GetTransactionItemBatch ( Microsoft.WindowsAzure.Storage.Table.TableContinuationToken &token ) : IEnumerable

For batch-processing all entities inside the transactions table.

GetTransactionTotalsItemBatch ( Microsoft.WindowsAzure.Storage.Table.TableContinuationToken &token ) : IEnumerable
GetTransactionsForCustomer ( System.Guid customerInternalId, int dateVal, bool onlyInvoiceable = false ) : Task>
GetTransactionsForInvoicing ( int mvanumber, int dateVal, bool includeId = true ) : Task>
SetTransactionAsBilled ( int mvanumber, System.Guid transactionID, int orderItemID ) : void

Private Methods

Method Description
AddReIndexRequestIfNeeded ( ) : void
EnsureTransactionHasCustomerInternalID ( ) : void
SerializeTransactionAndAddToQueue ( Transaction t ) : void

For internal use, skips Transaction validation.

Method Details

AddOrUpdateTransaction() public method

Adds new transaction to table storage or updates an existing item. Throws exception when item is not valid, resolving customer external ID failed or if table storage operation fails.
public AddOrUpdateTransaction ( Transaction t ) : void
t Transaction Transaction item to add/update
return void

AddOrUpdateTransaction() public method

Inserts or updates (using merge operation) the transaction table entity.
public AddOrUpdateTransaction ( TransactionTableEntity ent ) : void
ent Unipluss.TransactionService.Models.TransactionTableEntity
return void

AddOrUpdateTransactionBatch() public method

Inserts or updates (using merge operation) a batch of transaction table entities. Also generates IDs for items that do not have them and sets Date to DateTime.Now if it is null.
Thrown when any of the items is not valid or if adding to either table storage or search index failed.
public AddOrUpdateTransactionBatch ( IEnumerable batch ) : void
batch IEnumerable Batch of Transaction items to add/update
return void

AddOrUpdateTransactionTotalsItem() public method

public AddOrUpdateTransactionTotalsItem ( ) : void
return void

AddReIndexableItemBatch() public method

public AddReIndexableItemBatch ( ) : void
return void

AddTransactionBatchToUpdateQueue() public method

Adds a batch of transaction items to WebJob queues. Workers process each queue item and add them to transaction table and search index. Can also be used for updating existing items if Transaction.ID is specified. Also generates IDs for items that do not have them and sets Date to DateTime.Now if it is null.
public AddTransactionBatchToUpdateQueue ( IEnumerable batch ) : IEnumerable
batch IEnumerable Batch of Transaction items to add/update
return IEnumerable

AddTransactionToUpdateQueue() public method

Adds the transaction item to WebJob queues. Workers process each queue item and add them to transaction table and search index. Can also be used for updating existing items if Transaction.ID is specified. Also generates ID if it's null and sets Date to DateTime.Now if it isn't set.
public AddTransactionToUpdateQueue ( Transaction t ) : Transaction
t Transaction Transaction item to add/update
return Transaction

DeleteReIndexItemBatch() public method

public DeleteReIndexItemBatch ( ) : void
return void

DeleteTransaction() public method

Deletes transaction table storage entity that matches the mva number and ID. Throws exception when a entity is found with given ID but entity's mva number does not match with the one given as input.
public DeleteTransaction ( int mvanumber, System.Guid id ) : void
mvanumber int
id System.Guid
return void

DeleteTransactionTotalsItemWithID() public method

public DeleteTransactionTotalsItemWithID ( ) : void
return void

EnsureStorageCreated() public method

public EnsureStorageCreated ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

GetReIndexableItemBatch() public method

public GetReIndexableItemBatch ( Microsoft.WindowsAzure.Storage.Table.TableContinuationToken &token ) : IEnumerable
token Microsoft.WindowsAzure.Storage.Table.TableContinuationToken
return IEnumerable

GetTransactionItemBatch() public method

For batch-processing all entities inside the transactions table.
public GetTransactionItemBatch ( Microsoft.WindowsAzure.Storage.Table.TableContinuationToken &token ) : IEnumerable
token Microsoft.WindowsAzure.Storage.Table.TableContinuationToken For continuing a batch query or null to start from the beginning
return IEnumerable

GetTransactionTotalsItemBatch() public method

public GetTransactionTotalsItemBatch ( Microsoft.WindowsAzure.Storage.Table.TableContinuationToken &token ) : IEnumerable
token Microsoft.WindowsAzure.Storage.Table.TableContinuationToken
return IEnumerable

GetTransactionsForCustomer() public method

public GetTransactionsForCustomer ( System.Guid customerInternalId, int dateVal, bool onlyInvoiceable = false ) : Task>
customerInternalId System.Guid
dateVal int
onlyInvoiceable bool
return Task>

GetTransactionsForInvoicing() public method

public GetTransactionsForInvoicing ( int mvanumber, int dateVal, bool includeId = true ) : Task>
mvanumber int
dateVal int
includeId bool
return Task>

SetTransactionAsBilled() public method

public SetTransactionAsBilled ( int mvanumber, System.Guid transactionID, int orderItemID ) : void
mvanumber int
transactionID System.Guid
orderItemID int
return void

Property Details

tableRequestOptions protected_oe property

protected TableRequestOptions,Microsoft.WindowsAzure.Storage.Table tableRequestOptions
return Microsoft.WindowsAzure.Storage.Table.TableRequestOptions