UserManager Error - A second operation started on this context before a previous asynchronous operation completed

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 02:34:33

Maybe You forgot to await async function, and then next statement is trying to execute two queries on single connection?

It sounds like you are creating two contexts, both of which are of the same type of ApplicationDbContext. When EF detects two calls happening at the same time to the same context you get your error.

You will either have to create only one instance of your context per web request or split your context into it's component parts so both can be injected without a conflict.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!