sjh37 / EntityFramework-Reverse-POCO-Code-First-Generator

EntityFramework Reverse POCO Code First Generator - Beautifully generated code that is fully customisable. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It is free to academics (you need a .edu or a .ac email address), not free for commercial use. Obtain your licence from
https://www.reversepoco.co.uk/
Other
706 stars 230 forks source link

Error: No suitable method found to override: GetAsyncEnumerator in FakeDbSet #763

Closed slee-accesso closed 2 years ago

slee-accesso commented 2 years ago

Hi Simon - hope you're well,

I just upgraded to 3.6 recently. The generated FakeDbSet.cs code leaves me with this error:

CS0115 'FakeDbSet<TEntity>.GetAsyncEnumerator(CancellationToken)': no suitable method found to override

Commenting out the code makes it compile, Should I worry about this? Should we remove this code from the .ttinclude?

Code that I commented out:

public override IAsyncEnumerator<TEntity> GetAsyncEnumerator(CancellationToken cancellationToken = default)
{
    return new FakeDbAsyncEnumerator<TEntity>(this.AsEnumerable().GetEnumerator());
}

-Sean

slee-accesso commented 2 years ago

In further research, it appears that the class it is inheriting from is now using an interface, not an abstract or virtual method. So - the only thing that needs to happen is the removal of the "override".

slee-accesso commented 2 years ago

This was my fault. I had the EF 5 nuget packages installed. Switching to EF 6 fixed them. Sorry for the trouble.

sjh37 commented 2 years ago

Lol no problem Sean. Glad you figured it out.