Last post Oct 07, 2015 06:59 AM by PatriceSc
Oct 07, 2015 04:44 AM|sudip_inn|LINK
i just like to know what is the seeding concept in Entity Framework ?
i hard people say seed the work when they work with EF code first approach. so please guide me what does it mean seed in EF and what seed does?
Oct 07, 2015 05:03 AM|PatriceSc|LINK
EF can create the database for you and "seeding" just means inserting some initial data when the db is created (for example if you have a country table you may want to pre-populate this table with default countries etc...)
Oct 07, 2015 05:08 AM|sudip_inn|LINK
suppose by EF we create a country table with two fields named ID and Name and seed with some initial data but we add more country data there. after few days we decide to add one more column in that table called culture by code first then what will happen..........my
all data will be lost?
what option we need to turn on as a result data should not be lost. if possible please discuss.
Oct 07, 2015 06:59 AM|PatriceSc|LINK
No, the ALTER TABLE MyTable ADD <column definition> statement allows to add a new column to an existing table. You can drive this through EF using https://msdn.microsoft.com/en-s/data/jj591621.aspx