Not available for Offline object
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
If you get this error, working in CodeDress or the | If you get this error, working in CodeDress or the Framework in general, you have created an object without specifying which eco-space it belongs to. | ||
Change your object constructor to look like this | Change your object constructor to look like this: | ||
Class1 newObject = new Class1(this.AsIObject().ServiceProvider) | Class1 newObject = new Class1(this.AsIObject().ServiceProvider) | ||
Where '''this.AsIObject().ServiceProvider''' is the crucial part. | Where '''this.AsIObject().ServiceProvider''' is the crucial part. | ||
The IEcoServiceProvider is available from all IObjects. All objects of model classes | The IEcoServiceProvider is available from all IObjects. All objects of model classes have an AsIObject() method - you can find the service provider there: this.AsIObject().ServiceProvider. | ||
The this.ServiceProvider() shortcut is an extension method from namespace Eco.ObjectRepresentation. | The this.ServiceProvider() shortcut is an extension method from the namespace Eco.ObjectRepresentation. | ||
[[Category:C-Sharp]] | [[Category:C-Sharp]] |
Revision as of 07:31, 13 March 2023
If you get this error, working in CodeDress or the Framework in general, you have created an object without specifying which eco-space it belongs to.
Change your object constructor to look like this:
Class1 newObject = new Class1(this.AsIObject().ServiceProvider)
Where this.AsIObject().ServiceProvider is the crucial part.
The IEcoServiceProvider is available from all IObjects. All objects of model classes have an AsIObject() method - you can find the service provider there: this.AsIObject().ServiceProvider.
The this.ServiceProvider() shortcut is an extension method from the namespace Eco.ObjectRepresentation.
This page was edited more than 11 months ago on 02/10/2024. What links here