Hi,
I have this
public EnumCollection(Type type)
{
m_type = type;
bool isOk = true;
string nameType = m_type.Name == "D" ? "Dictionary" : m_type.Name; // D is alias for Dictionary
string nameTypeEntity = "Dipica.BM.DAL.EntityClasses." + nameType + "Entity";
string nameTypeCollection = "Dipica.BM.DAL.CollectionClasses." + nameType + "Collection";
m_error = nameTypeCollection + ": " + Environment.NewLine;
Type refTypeEntity = typeof(Dipica.BM.DAL.EntityClasses.MutationEntity); // any class will do
Type refTypeCollection = typeof(Dipica.BM.DAL.CollectionClasses.MutationCollection); // any class will do
Type typeEntity = refTypeEntity.Assembly.GetType(nameTypeEntity);
Type typeCollection = refTypeCollection.Assembly.GetType(nameTypeCollection);
EntityCollectionBase collection = (EntityCollectionBase)Activator.CreateInstance(typeCollection);
collection.GetMulti(null, 0, null, null, 0, 0); // TODO ok ???
if (Enum.GetValues(m_type).Length != collection.Count + 1)
{// + 1 for <undefined>
isOk = false;
m_error += "enum count (" + Enum.GetValues(m_type).Length.ToString() +
") <> database count (" + (collection.Count + 1).ToString() + ")" + Environment.NewLine;
}
....
}
piece of code.
How can I run this in v2? Is there a way to instantiate these collections? I can't figure it out :s
Thanks in advance!
Koen