Entity Framework 5.0 - Code First Migrations - How to update a database schema Part 2 of 2

preview_player
Показать описание
In this video I quickly go over using EF migrations to add and remove columns from the existing database that was initially created with code first.

Thank you for watching!! :D
Fabio Scopel
Рекомендации по теме
Комментарии
Автор

Getting the updates to work had been killing me. Thank you very much!!

MagianCreative
Автор

sir, so basically when we make any changes to our models we need to run "Add -Migration anyname" command and then simply provide "Update-database" command, right ????

dharmitvyas
Автор

Comments have had all my questions and their answers :). Excellent work Fabio. Very useful set of videos. Thank you!!

manojpokala
Автор

It's helpful for me. Hope ya guy make more videos like this. Thanks for your tutorials

MrVuthehiep
Автор

Thanks, very clear intros (all EF). Thanks for spending time doing this!

ebergerch
Автор

Thank you for the EF tutorial, all are clear and useful for me.

yazilimciningunlugucom
Автор

Thank you for your video it helped me with EF on Visual studio

ukaffairs
Автор

In Visual Studio, using migrations, when I run update-database, it says OK, the model is created in the database.

But when I open the database, there is no model, while when I run update-database in Visual Studio again, the error is that such an object already exists. Made but there is no model of this type in database where the problem can be? It is the same for all the models that I migrate

shabnamnikraftar
Автор

First question is How we can update db by C# code and how can we make it smart enough to do it automatically whenever application runs.??

compman
Автор

Yeh man ! You have done the exact thing, which I'm looking for :)
Thank you very much ! ! !

who-phpnerd
Автор

i can't believe i've been struggling with model first and database first all this time when code first is so much easier to use.

reinux
Автор

Thanks for the great Tutorial, how can i add new table to the existing Database?

saikiran
Автор

thank you. i have a question . is it possible to migrate database to lower version some how like this?

nedadra
Автор

It's really helpfull thanks!!
Can i ask you one question, what's the oposite command to update the context from the database

Thanks a lot!!

federicolezcano
Автор

Great work Mr Scopel, but the sound is not clear sometimes.

mondlism
Автор

Is it good approach to use entity framework? or will I have problem migrating my project. I once used datagrid view from tool box in my college minor project and it was a disaster when I moved it to my assigned PC in college.

Priosshrestha
Автор

Hi! Your videos are excellent references! Thank you very much!
When the database is updated, can i delete autogenerated update clases?

qweasdzxc
Автор

What is the order when I use CFM create one more table ?
I've tried Create Model -> Update Context file -> add Mirgration (cannot)

webvideochat
Автор

I'd like to use MODEL FIRST. I'd like to make changes in the model (the GUI) and have an automated (or at least a very simple "click") method of updating the database. This exist or in the works I wonder?

CalibrationExtreme
Автор

hi
here i am trying to add a column to product table, as a first changes in database
i added a column ImageURL_add string
and in pm>
i run command add-migration addImageUrl_add

but its continuously showing error
PM> add-migration addImageURL_add
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly
file specified."
At char:5
+ $utilityAssembly = ...
+
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileNotFoundException

You cannot call a method on a null-valued expression.
At char:5
+ $dispatcher =
+
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly
specified."
At char:5
+ $domain.CreateInstanceFrom(
+
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileNotFoundException


please help me

yogeshvaidya