The GetDataModelObject method is used to retrieve a new DataModel instance of the specified ispec or class.
Namespace – ABSuite.AccessLayer.Connector.Core
Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)
Syntax
Object GetDataModelObject(
string className
)
Arguments
classname – System.String
This argument provides an ispec name or a class name of the required DataModel.
Return Value
If this method succeeds, it returns an object for the required DataModel.
Using the IConnection Interface for the GetDataModelObject Method
The following code shows an example of using the GetDataModelObject() method to retrieve an instance of a specified DataModel:
// Create a new connection to the AB Suite host system // Use the Access Layer API ConnectionFactory to create an instance // of a Connection class. // If the DataModels assembly is referenced by the client project // directly (and no composition is required), then you can pass a // DataModels IspecFactory instance to the ConnectionFactory // Create a call ABSConnection = ConnectionFactory.Create(new Sample.Custom.DataModels.Core.IspecFactory()); // Create an instance of a required DataModel by using the // GetDataModelObject() method Sample.Custom.DataModels.Models.MENUModel menuModel= (Sample.Custom.DataModels.Models.MENUModel) ABSConnection.GetDataModelObject("MENU");