c# - Can NHibernate create tables from existing classes automatically? -
I am very new on this, but I need to create new tables from existing classes without having to manually. Can be done using a device or command line?
Yes, with nhibernate you can generate and update the schema automatically.
var cfg = new configuration (); Cfg.configure (); Cfg.AddAssembly (typef (aClassFromYourProject). Assembly); New Schemaxport (CFG) Excrete (false, true, false, false); Update: Overload options for schemainstant have changed to 3.x versions. The last argument is no longer necessary.
New Schemaxport (CFG). Unselected (true, true, false);
Comments
Post a Comment