This is a migrated thread and some comments may be shown as answers.

Defining metadatasource objects not in the enhanced assembly

1 Answer 18 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Diego
Top achievements
Rank 1
Diego asked on 22 Jul 2014, 02:21 PM
I understand the enhancer.exe utility must run on post-build of the assembly that contains entities, correct? I'd like to know what it looks for in order to determine if it should or should not apply the enhancing on the assembly. 

The assembly I am targeting has MappingConfiguration classes and the entity classes, but does not define any metadatasource objects. It seems like since you support the ability to dynamically add metadata sources using the AggregateMetadataSource object, then I should be able to instantiate the MetadataSource objects from wherever else in the application as long as I am passing in a complete metadata container to the OA context constructor. My problem is that the enhancer.exe is not executing against my entities assembly unless I define the FluentMetadataSource within that same assembly as my entities and mapping objects.

The code I am referring to is in GitHub and I have a unit test OAContextManagerTests.InitializeManager() that shows the error I'm talking about. The code is accessing a LocalDB instance of Northwind. The purpose of this particular code design is to encapsulate the ORM in abstraction and then compare both EF and OA against it:
https://github.com/diegohb/ORMPRS/tree/master/src

I'd really appreciate any support to figure this out. Could it be as simple as a parameter to the enhancer.exe that allows one to force enhancing based on class names or something regardless of preconditions explicitly checked?  

Thanks in advance...

1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 24 Jul 2014, 10:12 AM
Hello Diego,

Yes, you are right that the enhancer.exe would be called as a post build step. You could have a look at this blog post that explains how the Enhancer works in more details.

Currently enhancing entities that are not located in the same assembly as the respective MetadataSource is an unsupported scenario. This is also true for aggregating MetadataSources - if a MetadataSource is located in separate assembly, the entities must be located in this assembly as well. So in order to get this to work, you would need to change the architecture of your application in such a way that both entities and their MetadataSource are located in the same assembly. 

Please have a look at this feature request that targets similar scenario. Please vote for it if you are interested, it will help us prioritize it.

Let us know if you have any more questions or need any further assistance. 

Regards,
Boyan
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Development (API, general questions)
Asked by
Diego
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or