コード例 #1
0
        public void DeletePlate(string id)
        {
            var plate = GetPlate(id);

            if (plate is null)
            {
                throw new ArgumentException
                          ($"MobileTestingProduct with id = {id} doesn't exist");
            }

            if (plate.Gyroscope != null)
            {
                foreach (var gyroscopeId in plate.Gyroscope.Select(g => g.Id).ToList())
                {
                    _gyroscopeService.DeleteGyroscope(gyroscopeId);
                }
            }

            if (plate.Accelerometer != null)
            {
                foreach (var accelerometerId in plate.Accelerometer.Select(a => a.Id).ToList())
                {
                    _accelerometerService.DeleteAccelerometer(accelerometerId);
                }
            }

            _plateRepository.DeletePlate(id);
        }
コード例 #2
0
ファイル: GyroscopeController.cs プロジェクト: qKinDzaDza/MMD
 public void DeleteGyroscope(string id)
 {
     _gyroscopeService.DeleteGyroscope(id);
 }