Search code examples
c#-4.0appfabricappfabric-cache

App Fabric : While GET misses an Enum property


I have a class marked as CollectionDataContract which has a enum member. When I place an object of this class in Appfabric, I am through. When I get it back from App fabric, it does not deserialize the enum member. But I am not sure if the enum has been missed out in Serialization part itself.

Please do help.

If you need more information let me know.

Thanks.

[CollectionDataContract]
public partial class RuleConditionList : List<IRuleCondition>, IRuleCondition
{
   public LogicalOperator Operator;
}

where LogicalOperator is an enum


Solution

  • Any data member in a class marked with Collection data contract cannot be serialized by NetdataContractSerializer which is the serailization technique used by App fabric for storing data.

    To make things work we have two options:

    1. Make a wrapper for RuleConditionList
    2. Instead of Inheriting from List, make it as a property and change the attribute as DataContract.