public static Equipment UpdateEquipmentMap(EquipmentToUpdateDto equipmentToUpdate, Guid companyId) { return(new Equipment { Id = equipmentToUpdate.EquipmentId, Name = equipmentToUpdate.Name, Status = equipmentToUpdate.Status, StatusDate = equipmentToUpdate.StatusDate, SoldierId = equipmentToUpdate.SoldierId, CompanyId = companyId }); }
public async Task UpdateEquipment(EquipmentToUpdateDto equipmentToUpdate) { var companyId = (Guid)_soldierRepository.GetById(equipmentToUpdate.SoldierId).Result.CompanyId; await _equipmentRepository.UpdateEquipment( EquipmentMapper.UpdateEquipmentMap(equipmentToUpdate, companyId)); }
public async Task <ActionResult> UpdateEquipment([FromBody] EquipmentToUpdateDto equipmentToUpdate) { await _equipmentService.UpdateEquipment(equipmentToUpdate); return(Ok()); }