Not available for Offline object
(Created page with "If you get this error, working in CodeDress or the framework in general, you have created an object without specifying which eco-space it belong to. Change your object constr...")
 
(Updated Edited template to July 12, 2025.)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
If you get this error, working in CodeDress or the framework in general, you have created an object without specifying which eco-space it belong to.
<message>Write the content here to display this box</message>
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.ServiceProvider)
  Class1 newObject = new Class1(this.AsIObject().ServiceProvider)
Where '''this.ServiceProvider''' is the crucial part.
'''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.
[[Category:C-Sharp]]
{{Edited|July|12|2025}}

Latest revision as of 05:53, 20 January 2025

This page was created by Lars.olofsson@mdriven.net 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.

MDriven Chat

How would you like to chat today?

Setting up your conversation…

This may take a few moments