I\'m trying to manually build a WCF Data Service using a POCO data model and I cannot figure out how to properly expose enum values. Assuming a simple model lik
Maybe we can "cheat" it with the below workaround:
[System.Data.Services.IgnoreProperties("Status")]
public class Order
{
public int ID {get; set;}
public string Description {get; set;}
public OrderStatus Status {get; set;}
public int StatusValue
{
get
{
return (int)this.Status;
}
set
{
// Add validation here
this.Status = (OrderStatus)value;
}
}
}
public enum OrderStatus
{
New,
InProcess,
Complete
}