Im am trying to use extension method .ToListAsync()
but for some reason this extension method not available for me.
My set up as follows:
using System.Data.Entity;
Entity Frame Work v6.2
My Web Project does reference my DataAccess project.
Im not sure where i went wrong. Can somebody please advise?
Thank you!
The ToListAsync
method is part of the QueryableExtensions
class which is in the System.Data.Entity
namespace and part of the EntityFramework.dll
library. This means that you need import the namespace (i.e. using System.Data.Entity;
) as well as reference EntityFramework.dll
.
Note that in classic .Net Framework projects, references are not transitive. In other words, if you want to use classes from a library, you must reference it in every project. This has changed in .Net Core though.