I am working on .NET Core 3.1 with TravelPort API.
I want to store the flight request and flight response into our database. Saving data into database takes too much time.
await context.Logs.AddAsync(new Log()
{
Request = JsonSerializer.Serialize(seatMapReq),
Response = JsonSerializer.Serialize(res.SeatMapRsp),
ReqFileName = reqFileName,
ResFileName = resFileName,
RequestType = "Air_Seat_Map",
Success = true,
});
await context.SaveChangesAsync(); // in this line API take 5s-6s
How can I optimize this?