我关注了Enum:
[DataContract]
public enum Gender
{
[EnumMember(Value = "m")]
Male,
[EnumMember(Value = "f")]
Female
}
在以下请求中使用:
public class AddPlayerRequest : IReturn<AddPlayerResponse>
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Nationality { get; set; }
public DateTime Birthdate { get; set; }
[ApiAllowableValues("Gender", "Male", "Female")]
public Gender Gender { get; set; }
}
当使用 ServiceStackVS 扩展程序生成DTO时,将生成Gender enum,如下所示:
public virtual Gender Gender { get; set; }
但是客户对性别枚举一无所知,那我该如何处理呢?