zzzprojects / EntityFramework-Classic

Entity Framework Classic is a supported version of the latest EF6 codebase. It supports .NET Framework and .NET Core and overcomes some EF limitations by adding tons of must-haves built-in features.
https://entityframework-classic.net
Other
103 stars 27 forks source link

Exception: 'Stream not found.' when using UpdateFromQueryAsync #7

Closed neoGeneva closed 5 years ago

neoGeneva commented 5 years ago

Here's the stacktrace:

   at .(DbContext this, String )
   at .(DbContext this, List`1 , String )
   at .(DbContext )
   at .(DbContext )
   at .(DbContext this)
   at DbContextExtensions.UpdateFromQuery[TEntity](IQueryable`1 query, Expression`1 updateExpression, Action`1 bulkOperationFactory)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
   at DbContextExtensions.UpdateFromQueryAsync[TEntity](IQueryable`1 query, Expression`1 updateExpression)

It's hard to tell exactly what's going on, but at a guess it looks like something is trying to read the csdl, ssdl and msl, but not loading it from the in memory resources generated by EntityFrameworkManager.UseDatabaseFirst()

Sorry if this isn't the correct repo for this issue, I wasn't sure where to log issues for Z.EntityFramework.Extensions.Classic

Version:

OS: Windows 10 TargetFramework: netcoreapp2.1

JonathanMagnan commented 5 years ago

Hello @neoGeneva ,

Thank, we forget to test this method with database first

The code still tries to read the model as it normally does for EF6 instead of taking the model/file that's already loaded.

I guess that's not the only method that will fail for database first. We will for sure try to fix everything tomorrow and have a way database first unit test!

Best Regards,

Jonathan

neoGeneva commented 5 years ago

Hey, thanks so much @JonathanMagnan

I'm loving this project so far, thanks for picking up the slack the EF team left behind!

JonathanMagnan commented 5 years ago

Hello @neoGeneva ,

Just to let you know that this issue has been fixed but we prefer to make a few more tests before releasing it. A new version should be available before Monday.

Thank you for your good word ;)

Best Regards,

Jonathan

JonathanMagnan commented 5 years ago

Hello @neoGeneva ,

The v7.0.14 has been released.

We should now read the resource that has been generated by the UseDatabaseFirst method instead of trying to retrieve them (the logic used in the .NET Framework)

Let me know if everything is working as expected.

Best Regards,

Jonathan

neoGeneva commented 5 years ago

Looks like it's working as expected now, thanks!