asp.net mvc - Entity framework exception while fetching entities -


i using entityframework , mvc web api project, below code entity. issue when calling 1 method throws error

a second operation started on context before previous asynchronous operation completed. use 'await' ensure asynchronous operations have completed before calling method on context. instance members not guaranteed thread safe

i want mention few things, using singleton object context using autofac , owin, api hosted on azure , method calling method can async or not.

public iqueryable<entity> all() {     return this.context.entities; }  public entity one(expression<func<entity, bool>> predicate) {     return this.all().firstordefault(predicate); } 

thank you.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -