public async Task UpdateAsync(Consent consent)
        {
            var result = await Collection.ReplaceOneAsync(
                Filter.ById(ConsentSerializer.GetId(consent.ClientId, consent.Subject)),
                _serializer.Serialize(consent),
                PerformUpsert).ConfigureAwait(false);

            Log.Debug(result.ToString);
        }
        public async Task <Consent> LoadAsync(string subject, string client)
        {
            BsonDocument found = await Collection.FindOneByIdAsync(ConsentSerializer.GetId(client, subject)).ConfigureAwait(false);

            if (found == null)
            {
                return(null);
            }
            Consent result = _serializer.Deserialize(found);

            return(result);
        }
        public async Task RevokeAsync(string subject, string client)
        {
            var result = await Collection.DeleteOneByIdAsync(ConsentSerializer.GetId(client, subject)).ConfigureAwait(false);

            Log.Debug(result.ToString);
        }
 public ConsentStore(IMongoDatabase db, StoreSettings settings) :
     base(db, settings.ConsentCollection)
 {
     _serializer = new ConsentSerializer();
 }