public async Task DeleteByAppIdAsync(string appId) { var allCharts = await _chartRepository.GetAllAsync(a => a.AppId == appId); if (allCharts != null && allCharts.Any()) { foreach (var chart in allCharts) { await _chartRepository.DeleteAsync(chart.Id); } } }
public async Task <IActionResult> Delete(string id) { await _chartRepository.DeleteAsync(id); return(Ok()); }