Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

How to ignore or stop creating table from class EF code first

$
0
0

suppose i have a employee class and i want when i will migrate or run our project then EF will not create employee table. so is there any attribute which i can use for a class to ignore it?

i found NotMapped attribute. does it stop EF to create db table for Product class?

[NotMapped]publicclassProduct{publicintId{ get;set;}publicstringName{ get;set;}publicintIssuedQuantity{ get;set;}publicintInhandQuantity{ get;set;}publicvirtualICollection<OrderedItem>OrderedItems{ get;set;}...}


Viewing all articles
Browse latest Browse all 1698

Trending Articles



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