Esempio n. 1
0
        /// <inheritdoc />
        public void StoreElement(XElement element, string friendlyName)
        {
            var newKey = new DataProtectionEntity
            {
                FriendlyName = friendlyName,
                Xml          = element.ToString(SaveOptions.DisableFormatting)
            };

            _context.Document.CreateAsync(_database, _collection, newKey).Wait();
        }
Esempio n. 2
0
        /// <inheritdoc />
        public void StoreElement(XElement element, string friendlyName)
        {
            using var scope = _services.CreateScope();

            var context = scope.ServiceProvider.GetRequiredService <ArangoContext>();
            var newKey  = new DataProtectionEntity
            {
                FriendlyName = friendlyName,
                Xml          = element.ToString(SaveOptions.DisableFormatting)
            };

            context.CreateDocumentAsync(_database, _collection, newKey).Wait();
        }