public Model(ISessionFactory sessionfactory, ComponentType type)
{
if (type == null) throw new ArgumentNullException("type");
IsComponent = true;
Type = type.ReturnedClass;
ComponentType = type;
Metadata = sessionfactory.GetClassMetadata(Type);
Properties = new Dictionary<string, IType>();
Components = new Dictionary<string, Model>();
BelongsTos = new Dictionary<string, ManyToOneType>();
OneToOnes = new Dictionary<string, OneToOneType>();
Anys = new Dictionary<string, AnyType>();
HasManys = new Dictionary<string, Collection>();
HasAndBelongsToManys = new Dictionary<string, Collection>();
foreach (var pc in type.PropertyNames) {
var index = type.GetPropertyIndex(pc);
var x = type.Subtypes[index];
CategorizeProperty(sessionfactory, x, pc);
}
}