web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

List of Enum type in DataContract and custom Service integration

(0) ShareShare
ReportReport
Posted on by

Hello All,

Hello all i am using a list of Enum exactly like the example below 

[
DataMemberAttribute,
AifCollectionTypeAttribute('return', Types::Enum, enumStr(LogisticsLocationRoleType)),
AifCollectionTypeAttribute('_addressPurposes', Types::Enum, enumStr(LogisticsLocationRoleType))
]
public List parmAddressPurposes(List _addressPurposes = addressPurposes)
{
addressPurposes = _addressPurposes;

return addressPurposes;
}

I am using this in a datacontract and exposing the same datacontract in a custom service.

I am using this custom service in one of our c# project. 

The problem i am facing is: In the service reference i am getting this as a list of string (example below)

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.CollectionDataContractAttribute(Name="ArrayOfLogisticsLocationRoleType", Namespace="http://schemas.datacontract.org/2004/07/Dynamics.AX.Application", ItemName="LogisticsLocationRoleType")]
[System.SerializableAttribute()]
public class ArrayOfLogisticsLocationRoleType : System.Collections.Generic.List<string> {
}

What should i do to have this list as a enum in the data contract as well as the service reference in our c# project. Any help would be great !!! 

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans