Hi
I have a view that gets the users from pg_user (field name usename) view with some filter condition. I am trying to map this view in entity framework and I am getting an error saying name datatype cannot be mapped. I tried to cast the name type to text but postgresql doesnt accept that cast. Is there any other way to get this done?
Thanks
Anandhi
Map data type "name" in entity framework
There is a general rule: any data type can be used in Entity Framework if the database allows to work with the data type in the way like it works with a primitive type.
So if some "advanced" type can be read as byte array (or string or int etc) and be successfully inserted in the same way, there is a common solution:
- import table in the model within Entity Developer
- change the data type of the "advanced" column in SSDL to the corresponding primitive database data type (which is supported)
- adjust the "advanced" column data type in CSDL (set it to the corresponding .NET type)
If the "advanced" type cannot be treated as a primitive type, there is no possibility to use it in Entity Framework.
So if some "advanced" type can be read as byte array (or string or int etc) and be successfully inserted in the same way, there is a common solution:
- import table in the model within Entity Developer
- change the data type of the "advanced" column in SSDL to the corresponding primitive database data type (which is supported)
- adjust the "advanced" column data type in CSDL (set it to the corresponding .NET type)
If the "advanced" type cannot be treated as a primitive type, there is no possibility to use it in Entity Framework.