I want to be able to take in a string and call GetType()
and find the type. Which I do here and it works perfectly fine.
Type TypeToUse = typeof(someclass).Assembly.GetType("MyProj.Data.Stuff.MyClass");
But when I use the type I found TypeToUse
to create my observable collection it says the namespace can't be found.
ObservableCollection<TypeToUse> MyList = new ObservableCollection<TypeToUse>();
How do I fix this?
I'm actually trying to do this with a generic repository I'm assuming I have to add public virtual Type MakeGenericType(params Type[] typeArguments); to the Repository class?
Type elementType = typeof(ColorFilter).Assembly.
GetType("Photometrics.Data.Model.Entity.PhantomModels.Chamber");
Type CoreRepoType = typeof(CoreRepository<>).Assembly.
GetType("Photometrics.Data.Sql.Repository.CoreRepository");
Type combinedType = CoreRepoType.MakeGenericType(elementType);