Issue with EntityFramework6.Npgsql for .NET 4.8 framework.
I am trying to import views from postgres env, we are getting error of primary key not found in views, however primary keys are added in tables.
For the work around I added views manually in .NET .edmx file.
- In the context file, I added reference
- Added Entity file in
*.tt - Added reference of views in
.edmxat different places like store, mapping and entitySet.
It is compiling and not showing any error. However when I am running the solution it is throwing this error:
System.InvalidOperationException
HResult=0x80131509
Message=The entity type vwuserlogin is not part of the model for the current context.StackTrace:
at System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type entityType)
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet1.Initialize() at System.Data.Entity.Internal.Linq.InternalSet1.get_InternalContext()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_Local()'connectData.vwuserlogins.Local' threw an exception of type 'System.InvalidOperationException'
- Npgsql version: -4.1.12
- EntityFramework.Npgsql- 6.4.3
- PostgreSQL version: 14
- Operating System: Windows
Thanks