Microsoft.EntityFrameworkCore.Relational namespace (using) won't resolve

.net-core asp.net-core entity-framework-core npgsql

Question

I'm using EF as my ORM, and I need to execute some raw SQL against my postgres DB, to offload some JSON (jsonb) processing.

I'm using EntityFramework Core 1.1.0, with the npgsql provider for postgres. Per the latest docs on executing SQL, I need to use context.[entity].FromSql() - where FromSql is in the Microsoft.EntityFrameworkCore.Relational namespace.

So, I added that package via NuGet... The screenshot shows the problem - the reference is added, but it won't resolve in my code:

Namespace not resolving

I've tried uninstalling and reinstalling the Core SDK and VS developer tools (VS 2015). Any help appreciated.

Edit, showing full reference: Full reference screenshot

1
0
2/21/2017 6:06:37 PM

Accepted Answer

Reference and namespace are different things. The RelationalQueryableExtensions class you are seeking is located in the showed referenced assembly under Microsoft.EntityFrameworkCore namespace.

@IvanStoev was correct. The reference added the .FromSql extension to my entities after including the base Microsoft.EntityFrameworkCore namespace.

1
2/21/2017 5:59:19 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow