If you have a set of tables in the database that strictly consist of a string description and an ID, what is the best way to load these via NHibernate?
So suppose I have a Sandwich class, and a sandwich has a meat, a cheese, and a vegetable, where those three things are lookup tables in the DB. It seems to be the most conformant to NHibernate philosophy to have
public class Meat { string name; int id; }
public class Cheese { string name; int id; }
public class Vegetable { string name; int id; }
public class Sandwich { Meat meat; Cheese cheese; Vegetable vegetable; }
But with a few dozen tables like this in the database, classes seem to proliferate quickly. Suppose I set it up like this:
public class NameAndID { string name; int id; }
public class Sandwich { NameAndID meat; NameAndID cheese; NameAndID vegetable; }
Is this feasible? How would it be implemented in Fluent NHibernate?