public void RepairTieFighterByCode(string code) { var fighter = _repository.GetTieFighterByCode(code); // Check if object is not null before accessing it if (fighter != null) { fighter.IsDamaged = false; } }
public IActionResult Get(string code) { var item = _tieFighterRepository.GetTieFighterByCode(code); return(Ok(item)); }