🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
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...")
 
No edit summary
Line 4: Line 4:
  Class1 newObject = new Class1(this.ServiceProvider)
  Class1 newObject = new Class1(this.ServiceProvider)
Where '''this.ServiceProvider''' is the crucial part.
Where '''this.ServiceProvider''' is the crucial part.
The IEcoServiceProvider is available from all IObjects. All objects of model classes has an AsIObject() method - you can find service provider there: this.AsIObject().ServiceProvider.
The this.ServiceProvider() shortcut is an extension method from namespace Eco.ObjectRepresentation.

Revision as of 13:00, 26 May 2020

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 belong to.

Change your object constructor to look like this;

Class1 newObject = new Class1(this.ServiceProvider)

Where this.ServiceProvider is the crucial part.

The IEcoServiceProvider is available from all IObjects. All objects of model classes has an AsIObject() method - you can find service provider there: this.AsIObject().ServiceProvider.

The this.ServiceProvider() shortcut is an extension method from namespace Eco.ObjectRepresentation.

MDriven Chat

How would you like to chat today?

Setting up your conversation…

This may take a few moments