public async Task <ActionResult <Equipment> > GetEquipment(int id) { var equipment = await _repository.GetEquipment(id); if (equipment == null) { return(NotFound()); } return(equipment); }
private async Task <List <Equipment> > CheckEquipment(List <CreateRental> items) { var equipment = new List <Equipment>(); foreach (var item in items) { var eq = await _equipmentsRepository.GetEquipment(item.EquipmentId); if (eq == null) { return(null); } if (!equipment.Contains(eq)) { equipment.Add(eq); } } return(equipment); }