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

Reference to Telerik.OpenAccess.dll

1 Answer 262 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.
Manuel
Top achievements
Rank 1
Manuel asked on 20 Mar 2014, 02:50 PM
Is there a way to separate (put it in different libraries) the Entities and the and the FluentMetadataSource?

Right now I have to put a reference Telerik.OpenAccess.dll to all my projects. (e.g. DAL and Biz Projects /Libraries)

Thank you,
Manuel

1 Answer, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 25 Mar 2014, 12:29 PM
Hello Manuel,

I am sorry for the inconvenience you are experiencing.

Generally, the recommended approach for building a class library that holds a fluent model is to place in it the persistent classes, the metadatasource, and the context class. An organization in which the classes are separated from the rest of the model in another assembly is not supported.

This is necessary, because Telerik Data Access executes a post build task on the persistent classes that injects a variety of runtime features (more details are available here). In other words, in case you separate the classes in a different assembly, the post build task will be skipped and the classes will not behave as expected during runtime.

On the other hand, such a separation will lead to a runtime exception (OpenAccessException: No metadata has been registered for class '<namespace_name>.<class_name>, <assembly_name>, version=XXX, culture=XXX, publicKeyToken=XXX') once you make a call to the assembly that holds the metadatasource.

I hope this helps. If you need additional information, do not hesitate to get back to us.


Regards,
Doroteya
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
Manuel
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Share this question
or