79384003

Date: 2025-01-24 10:35:46
Score: 1
Natty:
Report link

Thank you to the people that commented, and the different options, it isn't an architecture issue as I thought but as Guru-Stron suggested it's most likely an unawaited Async call.

I was doing a saveAsync without awaiting, completely my fault:

 _wrapper.RepositoryContext.AddAsync(dbSession);
 // save in the database
 _wrapper.RepositoryContext.SaveChangesAsync();

Changed to:

await _wrapper.RepositoryContext.AddAsync(dbSession);
// save in the database
await _wrapper.RepositoryContext.SaveChangesAsync();

Please upvote his comment, not this answer.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Blacklisted phrase (0.5): upvote
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Ian Jowett