For the life of me I have no Idea why Entity Framework makes using SQL views sooooooooooooo difficult.
My error
Severity Code Description Project File Line Suppression State Warning Error 6013: The table/view 'CONTESTANTS_DB.db_BOT.VUE_CONTESTANT_SCORE_LOG_SUBTOTALS' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it. CMS C:\APP_DEV\CMS\CMS\Models\CMS_DM_DATA_Model.edmx 1
This silly thing will not let me use my subtotal view because it does not have a Key.... Umm hello EF its a SQL view...
back in the past you could trick this thing by adding a guide or something... Today I seem to be out of luck
Here is my SQL VIEW
SELECT NEWID() AS ID, SC_CONTESTANT_ID, SC_CONTEST_ID, SUM(SC_SCORE) AS SCORE_LOG_SUBTOTALS, COUNT(SC_SCORE) AS NUM_LOG_ENTRIES FROM db_BOT.SC_SCORECARD_TBL GROUP BY SC_CONTESTANT_ID, SC_CONTEST_ID
If I knew of something other than EF I would use it... but I only know how to use EF... so has my project come to an end?
Is there no way around this nonsense?
Thanks!