public async System.Threading.Tasks.Task ReceiveDesignsAsync(int taskId, int[] obtainedDesIds, int[] designObt) { for (int i = 0; i < designObt.Length; i++) { var obtDes = await _db.ObtainedDesignRepository.GetByIdAsync(obtainedDesIds[i]); if (obtDes != null) { obtDes.Obtained += designObt[i]; await _designService.DecreaseQuantityAsync(obtDes.ComponentId, designObt[i]); await _db.ObtainedDesignRepository.UpdateAsync(obtDes); } } await _db.SaveAsync(); }