public IActionResult CreateATMBattery(ATMBatteryCreateRequest request) { if (!ModelState.IsValid) { return(BadRequest()); } _ATMBatteryRepository.CreateATMBattery(request); return(Ok()); }
public void CreateATMBattery(ATMBatteryCreateRequest battery) { _dbContext.AtmBatteries.Add(_mapper.Map <ATMBattery>(battery)); _dbContext.SaveChanges(); }