Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Commented Feature: Designer: Exclude unwanted columns from existing database [84]

$
0
0
"Very often when dealing w/ large tables you want your model to only deal w/ a subset of the full table's columns. Do you should be able to remove a column from the entity data model.
This won't work if the column is not nullable and you get the following error:
Employee.DepartmentID in table Employee must be mapped: It has no default value and is not nullable.
I understand that not having this column mapped prevents the EF from doing inserts but I often am not intrested in inserting. I may only want to do SELECTS and updates of certain columns.
There really needs to be a way to say to EF ""I want you to ignore these columns"". Now you can delete the columns from the .edmx file but as soon as you update your model from the database they will be put back."

This item was migrated from the DevDiv work item tracking system [ID=16792].

This work item originated from connect.microsoft.com. A member of the EF team at Microsoft should close the related Connect issue when closing this work item.

Comments: I'd love to have this in Code First too. Ignore a column and optionally provide a default value for inserted rows.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>