public async Task <SaveTypeOfRoomRes> Save(SaveTypeOfRoomReq saveTypeOfRoomReq) { SaveTypeOfRoomRes Result = new SaveTypeOfRoomRes(); try { DynamicParameters parameters = new DynamicParameters(); parameters.Add("@Name", saveTypeOfRoomReq.Name); parameters.Add("@Id", saveTypeOfRoomReq.Id); parameters.Add("@Status", saveTypeOfRoomReq.Status); parameters.Add("@AmountAdults", saveTypeOfRoomReq.AmountAdults); parameters.Add("@AmountChild", saveTypeOfRoomReq.AmountChild); parameters.Add("@PricePerNight", saveTypeOfRoomReq.PricePerNight); Result = await SqlMapper.QueryFirstOrDefaultAsync <SaveTypeOfRoomRes>(cnn : connection, sql : "sp_SaveTypeOfRoom", param : parameters, commandType : CommandType.StoredProcedure); return(Result); } catch (Exception) { return(Result); } }
public Task <SaveTypeOfRoomRes> Save(SaveTypeOfRoomReq request) { return(typeOfRoomRepository.Save(request)); }
public async Task <OkObjectResult> SaveTypeOfRoom(SaveTypeOfRoomReq request) { var result = await typeOfRoomService.Save(request); return(Ok(result)); }
public JsonResult Save([FromBody] SaveTypeOfRoomReq request) { var result = ApiHelper <SaveTypeOfRoomRes> .HttpPostAsync($"typeofroom/Save", "PATCH", request); return(Json(new { data = result })); }