Not available for Offline object
This page was created by Lars.olofsson on 2020-05-26. Last edited by Edgar on 2025-01-20.
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)
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.