I have an enum to enumerate shipment type with "O" representing outbound and "I" meaning Inbound. Which of the below is more appropriate and why? with DataContract and EnumMember
[DataContract]
public enum ShipmentType
{
[EnumMember(Value = "I")] Inbound,
[EnumMember(Value = "O")] Outbound,
}
with description
public enum ShipmentType
{
[Description("I")] Inbound,
[Description("O")] Outbound,
}
Context: ShipmentType in DB is stored as "I" or "O". But in code I would like to use them as an enum. But while storing back to DB I still want to get the values "I" or "O". There are extension methods for getting EnumMember and Description value from the enum.
Does using one provide any advantage over the other?