Ejemplo n.º 1
0
        public async Task Delete(string facebookId)
        {
            using (DynamoDbContext dbContext = new DynamoDbContext())
            {
                await dbContext.DeleteAsync <FacebookAuthModel>(facebookId).ConfigureAwait(false);

                //TODO: log
            }
        }
Ejemplo n.º 2
0
        public async Task Delete(string userEmail)
        {
            using (DynamoDbContext dbContext = new DynamoDbContext())
            {
                await dbContext.DeleteAsync <AuthModel>(userEmail);

                //TODO: log
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Deletes the user associated with the specified id.
 /// </summary>
 /// <param name="id"></param>
 public async Task Delete(string id)
 {
     using (DynamoDbContext context = new DynamoDbContext())
     {
         try
         {
             await context.DeleteAsync <UserModel>(id);
         }
         catch (Exception e)
         {
             //ADD LOGER
             throw new Exception(e.Message);
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Saves the supplied entity to the configured DynamoDb instance.
        /// Also amtains a reference to the save entity and will remove it from the database automatically when disposed.
        /// </summary>
        /// <typeparam name="T">The entity type</typeparam>
        /// <param name="entity">The entity instance</param>
        /// <returns>Task</returns>
        public async Task SaveEntityAsync <T>(T entity) where T : class
        {
            await DynamoDbContext.SaveAsync <T>(entity).ConfigureAwait(false);

            _cleanup.Add(async() => await DynamoDbContext.DeleteAsync(entity).ConfigureAwait(false));
        }
Ejemplo n.º 5
0
 private void InsertDatatoDynamoDB(DatabaseEntity entity)
 {
     DynamoDbContext.SaveAsync <DatabaseEntity>(entity).GetAwaiter().GetResult();
     CleanupActions.Add(async() => await DynamoDbContext.DeleteAsync(entity).ConfigureAwait(false));
 }