After upgrading .NET core version from 2.2 to 3.0 I got error on this:
_repository.Insert(new RequestStatusHistory()
{
RequestId = requestModel.Id ,
RequestStatusId = newRequestStatusId
});
public void Insert(T entity)
{
this._entity.Add(entity);
_context.SaveChanges();
}
And the error is:
New transaction is not allowed because there are other threads running in the session
What should I do? `