public async Task Apply(ListItemRemoved evnt) { using (IDbConnection dbConnection = new NpgsqlConnection(_connectionString)) { dbConnection.Open(); int result = await dbConnection.ExecuteAsync( "DELETE FROM todoitems WHERE id = @Id", new { Id = Guid.Parse(evnt.ItemId) }); } }
public async Task Apply(ListItemRemoved evnt) { await _store.FindOneAndUpdateAsync( evnt.ListId, x => x.Items.Remove(evnt.ItemId)); }