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?