I have a table
CREATE TABLE Tasks
( 
    ID INT IDENTITY(1,1) NOT NULL CONSTRAINT PRIMARY KEY PkTasks,
    ...other fields...
)
and a view
CREATE VIEW VTaskInfo
AS
SELECT
 开发者_运维技巧   T.ID IDTask,
    ...other fields...
FROM
    Tasks T
How can I create navigation property connecting 'Task' and 'VTaskoInfo' entities? Usually defining navigation properties requires deleting id property, but this time property is primary key and can't be deleted. I could change VTaskInfo definition to
CREATE VIEW VTaskInfo
AS
SELECT
    T.ID IDTask,
    T.ID ID,
    ...other fields...
FROM 
    Tasks T
and specify ID as entity key and IDTask as navigation property, but I don't like this solution. Is there something else I can do?
How do you map views in EF?
Here's an article regarding using EF and DB Views:
http://smehrozalam.wordpress.com/2009/08/12/entity-framework-creating-a-model-using-views-instead-of-tables/
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论