Optimization - Saving into Database takes too much time ASP.NET Core 3.1

63 Views Asked by At

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?

0

There are 0 best solutions below