Ejemplo n.º 1
0
        public async Task ClearAsync(string userId)
        {
            var client = dbAccess.GetClient();
            var wk     = client.CreateDocumentQuery <Warenkorb>(UriFactory.CreateDocumentCollectionUri(DbAccess.DBName, DbAccess.WarenkorbCollectionName))
                         .Where(p => p.UserId == userId);

            foreach (var s in wk)
            {
                await client.DeleteDocumentAsync(UriFactory.CreateDocumentUri(DbAccess.DBName, DbAccess.WarenkorbCollectionName, s.Id));
            }
        }
        public async Task DeleteSucheAsync(string sessionId)
        {
            var client = dbAccess.GetClient();
            var suchen = client.CreateDocumentQuery <Suche>(UriFactory.CreateDocumentCollectionUri(DbAccess.DBName, DbAccess.SucheCollectionName))
                         .Where(p => p.SessionId == sessionId);

            foreach (var s in suchen)
            {
                await client.DeleteDocumentAsync(UriFactory.CreateDocumentUri(DbAccess.DBName, DbAccess.SucheCollectionName, s.Id));
            }
        }