One of my modules which holds my entities is loaded in orchard through dynamic compilation.
In another module (which references my entities module) I would like to create instanses of an entity in a dynamic way by passing in the entity type as a string value to a method call, using reflection.
This works ok if i know the assembly name of my entities module i could call something like :
string fullyqualifiedtypename ='EFDAL.Entity.WorkItem, MyAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
Type t = Type.GetType(fullyqualifiedtypename , false, true);
But now since my entities module is dynamically compiled by orchard i cannot do it because i dont know the assembly name given by orchard via dynamic compilation in order to build the fullyqualifiedtypename.
Using the debugger the assembly name made by Orchard is called :
EFDAL.Entity.WorkItem, App_Web_fpqdyyuy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Its the fragment "App_Web_fpqdyyuy" which is assigned by orchard as the assembly name which i dont know how to find so i can build the fully qualified name.
Is there a way to actually find the assembly name Orchard has given to dynamically compiled assemblies in order to cover the scenario described ?