private void ValidateMaintenanceIfNotExist(MaintenanceModel MaintenanceModel) { var existingEntity = _MaintenanceRepository.GetByIdAsync(MaintenanceModel.ID); if (existingEntity == null) { throw new ApplicationException($"{MaintenanceModel.ToString()} with this id is not exists"); } }
private async Task ValidateMaintenanceIfExist(MaintenanceModel MaintenanceModel) { var existingEntity = await _MaintenanceRepository.GetByIdAsync(MaintenanceModel.ID); if (existingEntity != null) { throw new ApplicationException($"{MaintenanceModel.ToString()} with this id already exists"); } }