public void Post([FromBody] RentModel value) { try { _rentCarService.RentCar(value); } catch (Exception e) { Console.WriteLine(e); } }
public async Task <IActionResult> RentCar([FromBody] RentCarRequestDto dto, CancellationToken cancellationToken = default(CancellationToken)) { var result = await _rentCarService.RentCar(dto, cancellationToken); if (result == null) { return(BadRequest(new ApiResponse(StatusCodes.Status400BadRequest))); } var response = new ApiOkResponse(result); return(Ok(response)); }
public async Task Handle(string eventName, string message) { switch (eventName) { case KafkaConstants.Place_Car_Order_Event: var carModel = _messageSerializer.DeSerialize <PlaceCarOrderMessage>(message); _rentCarService.RentCar(new RentModel() { CarNumber = "hskjds89", CreatedDate = DateTime.Now, RentPrice = carModel.CarRentPrice, Staus = "Done", TransactionId = carModel.TransactionId }); return; case KafkaConstants.Cancel_Car_Order_Event: _rentCarService.CancelRentCar(message); return; } }
public override void Execute() { _rentCarService.RentCar(_rentModel); }