Here's my problem. A class which defines an order has a property called PaymentStatus
, which is an enum
defined like so:
public enum PaymentStatuses : int
{
OnDelivery = 1,
Paid = 2,
Processed = 3,
Cleared = 4
}
And later on, in the class itself, the property definition is very simple:
public PaymentStatuses? PaymentStatus { get; set; }
However, if I try to save an order to the Azure Table Storage, I get the following exception:
System.InvalidOperationException: The type Order+PaymentStatuses' has no settable properties.
At this point I thought using enum
isn't possible, but a quick Google search returned this: http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/7eb1a2ca-6c1b-4440-b40e-012db98ccb0a
This page lists two answers, one of which seems to ignore the problems and suggests that using an enum
in Azure Storage is fine.
Now, I don't NEED to store the enum
in the Azure Table Storage as such, I could just as well store a corresponding int
, however, I do need this property to be exposed in the WCF service.
I've tried making the property use get
and set
to return the enum
from a stored integer
, and remove this property from Azure by using the WritingEntity
event on my DataContext
, but I get that exception before the event for this entity is fired.
At this point, I'm at a loss, I don't know what else I can do to have this property in WCF as an enum
, but have Azure store just the int
.