Click or drag to resize

DataObjectControllerLoadObjects Method

Loads a number of dataobjects from the database corresponding to the specified load options.

Namespace:  Omada.OE.AppLogic
Assembly:  Omada.OE.AppLogic (in Omada.OE.AppLogic.dll) Version: 15.0.0.0
Syntax
C#
public virtual DataObjects LoadObjects(
	DataObjectLoadOptions loadOptions
)

Parameters

loadOptions
Type: Omada.OE.ModelDataObjectLoadOptions
Specifies a number of load options.

Return Value

Type: DataObjects
Examples
The following example implements a code method that returns a textual description of all the property values for a data object.
using System;
using Omada.OE.Model;
using Omada.OE.AppLogic;

namespace CodeAssembly1
{
  public class Main
  {
    public bool GetActionObjectDescription(CodeMethodInvokeContext context, out string result)
    {
      DataObjectLoadOptions loadOptions = new DataObjectLoadOptions();
      loadOptions.IdPosList.Add(context.ActionObjectId);
      DataObjectController controller = context.Factory.CreateController<DataObjectController>();
      DataObjects dataObjects = controller.LoadObjects(loadOptions);
      if (dataObjects.Count == 0)
        throw new Exception("Action object not found: " + context.ActionObjectId);
      DataObject actionObject = dataObjects[0];

      result = "Description for \"" + actionObject.DisplayName + "\": ";
      foreach (DataObjectVersionProperty versionProperty in actionObject.CurrentVersion.Properties)
        result += "\r\n" + versionProperty.GetProperty().Name + ": " + versionProperty.ToString();

      return true;
    }
  }
}
See Also