|
Article relates to
|
Telerik OpenAccess ORM
|
|
Created by
|
Viktor Zhivkov
|
|
Last modified
|
September 14, 2012
|
|
Last modified by
|
Doroteya Agayna
|
DESCRIPTION
If you experience the following error
“Type ‘[FLUENT MODEL CONTEXT TYPE NAME]’ is currently incompatible with Add OpenAccess Service. In order to make it compatible please follow the online instructions.” while trying to add OpenAccess Service you can use any of the provided solutions in order to fix the compatibility issue.
Example error message
The issue is related to the way Add OpenAccess Service wizard discovers the context model types. There are two ways that can solve it:
- Provide specially named static field for MetadataSource or MetadataContainer
- Provide a way to initialize an instance of the context model using default or single System.String parameter constructors
After applying either of the solutions please rebuild your project/solution and run the wizard again.
For more details how to implement the recommended approaches see the sections below.
SOLUTION 1 - Declare and initialize a private static field
Use MetadataSource:
Add the following code to your Fluent Context Model class:
You can initialize the field with any of the three possible metadata source types:
•
AttributesMetadataSource
• XmlMetadataSource
• FluentModelMetadataSource
Use MetadataContainer:
Add the following code to your Fluent Context Model class:
You can initialize the field using
GetModel() method of your MetadataSource.
SOLUTION 2 – Provide expected constructor
Add OpenAccess Service can initialize a context model using either its default constructor or using a constructor that has single
System.String parameter.
NOTE: The single
System.String parameter is intended to be invoked with connection string.
Please
Sign In
to rate this article.