If you have a set of tables in a database that strictly consist of a row description and an identifier, what is the best way to load them through NHibernate?
So, suppose I have a sandwich class, and the sandwich has meat, cheese and vegetables, where these three things are lookup tables in the database. This seems to be the most consistent with NHibernate's philosophy to
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 dozens of tables like this in the database, classes seem to multiply quickly. Suppose I configured it like this:
public class NameAndID { string name; int id; } public class Sandwich { NameAndID meat; NameAndID cheese; NameAndID vegetable; }
Is it possible? How will this be implemented in Fluent NHibernate?
source share