public async Task Delete(string facebookId) { using (DynamoDbContext dbContext = new DynamoDbContext()) { await dbContext.DeleteAsync <FacebookAuthModel>(facebookId).ConfigureAwait(false); //TODO: log } }
public async Task Delete(string userEmail) { using (DynamoDbContext dbContext = new DynamoDbContext()) { await dbContext.DeleteAsync <AuthModel>(userEmail); //TODO: log } }
/// <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); } } }
/// <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)); }
private void InsertDatatoDynamoDB(DatabaseEntity entity) { DynamoDbContext.SaveAsync <DatabaseEntity>(entity).GetAwaiter().GetResult(); CleanupActions.Add(async() => await DynamoDbContext.DeleteAsync(entity).ConfigureAwait(false)); }