public async Task DeleteOrder(string id) { var collection = await this.stateManager.GetOrAddAsync <IReliableDictionary <string, T> >(CollectionName); using (ITransaction tx = this.stateManager.CreateTransaction()) { await collection.TryRemoveAsync(tx, id); DeleteCommand <T> saveCommand = new DeleteCommand <T>(); var data = new CaseBaseModel { Id = id }; saveCommand.Data = data; var saveQueue = await stateManager.GetOrAddReactiveReliableQueue <Commands.Command>("case"); await saveQueue.EnqueueAsync(tx, saveCommand); await tx.CommitAsync(); } }