Enums DTO properties turn into strings in the "add service stack reference"

This is the code on the server side :smile:

[DataContract]
public class ImportCompetitionsDataResponse : ResponseBase
{
[DataMember]
public FeedStatuses FeedStatuses { get; set; }

}

DataContract]
public enum FeedStatuses
{
[EnumMember]
Succesfull = 0,
[EnumMember]
WithParsingErrors = 1,
[EnumMember]
WithErrors = 2
}

Strangely on the client side the SS reference is built like this :

[DataContract]
public partial class ImportCompetitionsDataResponse
: ResponseBase
{
[DataMember]
public virtual string FeedStatuses { get; set; }
}

[DataContract]
public enum FeedStatuses
{
Succesfull,
WithParsingErrors,
WithErrors,
}

Strangely in another project (same SS version, same vs.net env) I don’t see this behavior … the property is correctly an enum …

What should I check ?
thank you
enrico

I’d check that you’re using the latest version of ServiceStack.

ok, moving from 4.0.60 to 4.5.0 did the trick :smile: thank you

1 Like