0

使用开箱即用的 WDE 自定义框架,是否可以从自定义业务属性的附件中读取?

4

1 回答 1

0

This worked for me:

Private field:

private readonly IConfigurationService _configurationService;

Your Ctor:

public YourThing(IConfigurationService configurationService)
{
    _configurationService = configurationService;
}

Somewhere in your class:

string dispositionBusinessAttributeName = [get your BA name here]; 

CfgEnumerator cfgEnumerator = _configurationService.RetrieveObject<CfgEnumerator>((ICfgQuery)new CfgEnumeratorQuery()
{
    TenantDbid = _configurationService.WorkingTenant,
    Name = dispositionBusinessAttributeName
});

CfgEnumeratorValueQuery enumeratorValueQuery = new CfgEnumeratorValueQuery();
enumeratorValueQuery.EnumeratorDbid = cfgEnumerator.DBID;
enumeratorValueQuery.TenantDbid = _configurationService.WorkingTenant;

ICollection<CfgEnumeratorValue> cfgEnumeratorValues = _configurationService.RetrieveMultipleObjects<CfgEnumeratorValue>((ICfgQuery)enumeratorValueQuery);
于 2017-04-13T14:52:32.493 回答