Double click on the warning shows the 'Resolve Validation Errors' form.
Selecting 'Map a column to this field' shows a User input column combobox.
This combobox is empty. I'm not able to select a column.
6 Answers, 1 is accepted
It seems that all of the columns of your table which is mapped to the class that implements the interface are already mapped to persistent fields. However this warning should not bother you too much as you can just run the Update Schema From Model wizard and OpenAccess will create a column for the members that you have implemented from your interface.
Best wishes,Zoran
the Telerik team
Monday, November 15, 11 am Eastern Time: Register here>>
Monday, November 15, 10 pm Eastern Time: Register here>>
I keep struggling with interfaces.
Is there an example somewhere?
I assume that Interfaces works the same way in c# as in Delphi.
I want to use an interface without new columns in the database.
This:
public abstract partial class MetaClass1 : Interface1 { private int iD; public virtual int ID { get { return this.iD; } set { this.iD = value; } } }And not this:
public abstract partial class MetaClass1 : Interface1 { private int iD; public virtual int ID { get { return this.iD; } set { this.iD = value; } } private int interface1ID; public virtual int Interface1.ID { get { return this.interface1ID; } set { this.interface1ID = value; } } }But how to implement an Interface in the visual designer?
I use at the moment an Inheritance relationship between MetaClass1 and Interface1.
You are definitely using the correct approach with interfaces in the Visual Designer, the inheritance relationship is the one that is intended to be used. I must admit I am not sure what is the desired result that you expect though from the example you have given in your last post. Are you intending to have an ID property only coming from your interface or would you like to have an ID property which is a property of your class and then the interface left to be implemented by yourself separately. If you have a property from your interface that has the same name as a property in your implementing class, then the result that you are getting is the expected one - the property is generated once as the member of the class and once as an explicit implementation of the interface. If you would like to have only one of the properties there you should just delete/rename one of the ID properties - either on the interface or the MetaClass.
If your intention is to implement the interface on your own and not having OpenAccess generating the implementation code - this is not something that we provide at the moment but we will definitely have it on our TODO list for the future. We are looking forward for your feedback, any suggestions will be highly appreciated.
Zoran
the Telerik team
I want to use an Interface on a couple of tables wich are used by Combobox/Dropdown/Autocomplete.
An interface with ID and Description.
public interface Interface1 { int ID { get; set; } string Description { get; set; } } public partial class MetaClass1 : Interface1 { private int iD; public virtual int ID { get { return this.iD; } set { this.iD = value; } } private string description; public virtual string Description { get { return this.description; } set { this.description = value; } } }Adding a MetaClass, an Interface and an Inheritance between them adds the 2 Interface MetaProperties to the implementations section of the MetaClass.
This results in 4 properties in the MetaClass1.generated.cs file.
Removing the 2 MetaProperties from the implementations section gives an error (after saving):
Errors were generated when initializing the transformation object. The transformation will not be run. The following Exception was thrown:
System.ArgumentNullException: Value cannot be null.
Parameter name: language
at Telerik.OpenAccess.Metadata.Utils.GetDomProvider(String language)
at Telerik.OpenAccess.Metadata.DefaultNamingStrategy.ValidateGeneratedName(String suggestion, MetaScopeType declaringType)
at Telerik.OpenAccess.Metadata.DefaultNamingStrategy.GetScalarFieldName(String propertyName, String userFieldName, MetaScopeType declaringType)
at Telerik.OpenAccess.InheritanceWorker.ImplementMemberFromInterface(String name, Type clrType, MetaInterface metaInterface, IList`1 targetClasses, MetadataWorker worker)
at Telerik.Data.Dsl.ImplementationAddRule.<>c__DisplayClass6.<ElementAdded>b__4()
at Telerik.Data.Dsl.DslBridge.RedoAction(ActionState state)
at Telerik.Data.Dsl.StateManager`1.AddNewState(T state)
at Telerik.Data.Dsl.ImplementationAddRule.ElementAdded(ElementAddedEventArgs e)
at Microsoft.VisualStudio.Modeling.AddRuleNotification.DoFireRule()
at Microsoft.VisualStudio.Modeling.RuleNotification.FireRule()
at Microsoft.VisualStudio.Modeling.Transaction.FireCommitTimeRules(SortedRuleNotificationList rulesToFire)
at Microsoft.VisualStudio.Modeling.Transaction.FireCommitTimeElementRules()
at Microsoft.VisualStudio.Modeling.Transaction.Commit()
at Microsoft.VisualStudio.TextTemplating56565F5FCA10B107CB7AE998027F6F64.GeneratedTextTransformation.Initialize() in d:\users\arjen\Mijn documenten\Visual Studio 2010\Projects\ConsoleApplication3\ConsoleApplication3\EntityDiagrams1.rlinq:line 41
at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result) 1 1
I got the feeling that would be the right approaches.
Regards,
Arjen
Well actually, if the properties of the interface and the ones of the MetaClass overlap each other, you should delete the ones of the MetaClass so that the class actually uses that ones that it implements from the interface. If a class implements an interface, it is not a good idea to delete the implemented properties that the class inherits from the interface.
Best wishes,Zoran
the Telerik team
Thats what I'm looking for.