'System.Linq.IQueryable<Microsoft.AspNet.Identity.EntityFramework.IdentityUser>' does not contain a definition for 'FirstOrDefaultAsync'

by sunil ravulapalli /18. December 2013 08:40 /entityframework /Comments (0)

If you get the following error

'System.Linq.IQueryable<Microsoft.AspNet.Identity.EntityFramework.IdentityUser>' does not contain a definition for 'FirstOrDefaultAsync' and no extension method 'FirstOrDefaultAsync'
accepting a first argument of type 'System.Linq.IQueryable<Microsoft.AspNet.Identity.EntityFramework.IdentityUser>' could be found (are you missing a using directive or an assembly reference?) 

For some reason visual studio is not able to help in adding the reference automatically using "Ctrl +." shortcut. You need to add in the following namespace to get this to work.

using System.Data.Entity;

 

blog comments powered by Disqus