c# - Why is the Up() method abstract and the Down() method virtual in the DbMigration class -
if @ signature of abstract class dbmigration
in system.data.entity.migrations
namespace:
public virtual void down(); public abstract void up();
you'll see down()
marked virtual
, up
marked abstract
. difference between virtual , abstract abstract function can have functionality in it.
what kind of functionality can up()
function have default , why isn't case th down()
function.
you need override up()
while overriding down()
optional. makes sense database migration instructions.
see what difference between abstract function , virtual function?.
Comments
Post a Comment