I'm developing an application which will have these classes:
class Shortcut
{
public string Name { get; }
public IList<Trigger> Triggers { get; }
public IList<Action> Actions { get; }
}
class Trigger
{
public string Name { get; }
}
class Action
{
public string Name { get; }
}
And I will have 20+ more classes, which will derive from Trigger
or Action
, so in the end, I will have one Shortcut
class, 15 Action
-derived classes and 5 Trigger
-derived classes.
My question is, which ORM will best suit this application? EF
, NH
, SubSonic
, or maybe something else (Linq2SQL
)?
I will be periodically releasing new application versions, adding more triggers and actions (or changing current triggers/actions), so I will have to update database schema as well. I don't know if EF
or NH
provides any good methods to easily update the schema. Or if they do, is there any tutorial how to do that?
I've already found this article about NH
schema updating, quoting:
Fortunately NHibernate provides us the possibility to update an existing schema, that is NHibernate creates an update script which can the be applied to the database.
I've never found how to actually generate the update script, so I can't tell NH
to update the schema. Maybe I've misread something, I just didn't found it.
Note: If you suggest EF
, will be EF
1.0 suitable as well? I would rather use some older .NET than 4.0.
Note 2: The ORM framework should be free for commercial usage.
Note 3: I will also use code obfuscation, randomly renaming all symbols etc... so to ORM should support this.
new SchemaUpdate(_cfg).Execute(true, false);
– KimmiNHibernate.Tool.hbm2ddl
namespace. All you need is access to the Configuration object. The tool simply compares the configuration to the current state of the database. – KimmiConfiguration.GenerateSchemaUpdateScript
method which does all the work. It definitely doesn't remove unmapped tables as that would be very bad. – Kimmi