Click or drag to resize

MainSampleCodeMethod Method

This is a sample code method.

A code method is a .Net method that can be executed by Omada Identity Manager when an event occurs.

In order for a .Net method be be a valid code method it must conform to a set of requirements:

RequirementDescription
Non-staticThe method must not be static.
Return boolThe method must return a boolean.
Invoke contextThe method must take a CodeMethodInvokeContext object as its first parameter.
Simple data typesThe method parameters (except the context) can only be of the following types: string, int, double or bool.
Examples
The following example shows the implementation of a sample code method.
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;

namespace Namespace1
{
  public class MyCodeMethodClass
  {
    public bool AppendText(CodeMethodInvokeContext context, string input, string append, out string result)
    {
      result = input + append;
      return true;
    }
  }
}
Remarks
Remember that Omada Identity can also be extended programatically using Browser Event Handlers and Form Parts.

Namespace:  Omada.OE.Solution.OIM.Assembly
Assembly:  Omada.OE.Solution.OIM.Assembly (in Omada.OE.Solution.OIM.Assembly.dll) Version: 15.0.0.0
Syntax
C#
public bool SampleCodeMethod(
	CodeMethodInvokeContext context,
	string inParam1,
	int inParam2,
	double inParam3,
	bool inParam4,
	out string outParam1
)

Parameters

context
Type: Omada.OE.ModelCodeMethodInvokeContext
inParam1
Type: SystemString
inParam2
Type: SystemInt32
inParam3
Type: SystemDouble
inParam4
Type: SystemBoolean
outParam1
Type: SystemString
A code method can output a result through out parameters.

Return Value

Type: Boolean
A code method always returns a boolean indicating whether the method succeeded.
See Also