79289723

Date: 2024-12-18 01:12:46
Score: 1
Natty:
Report link

Since the SessionId is generated by the database upon saving the session, you need to follow a two-step process to save both the Session and the associated SessionExplanations:

1- Save the session object to the database, which will generate and return the SessionId.

2- Once you have the SessionId, you can then save the SessionExplanations objects.

However, it is possible to streamline this process into a single API call. You can structure your API to accept a complete payload that includes the Session object and its related Explanation IDs. Then, handle both saving operations within a single transaction on the server side.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Mohammad Reza Mahdiani