Problem Scenario: There is an enum keeping track of operations to be performed on a table Public Enum PartitionKey { Createtask, Updatetask, Deletetask } User is entering the value for the operation to be performed and the code to check the value entered in switch case. Switch (value) { case PartitionKey.Createtask.ToS... { Create(); break; } case PartitionKey.Updatetask.ToS... { Update(); break; } case PartitionKey.Deletetask.ToS... { Delete(); break; } } and it displays as error ......
Below is the approach that can be implemented whenever there is a requirement of creating an Azure Table having entities with different schema definitions. We can have a Parent Entity defined which will hold the data common in all the entity types and then rest all entities should inherit from this parent class. There will be only on DataServiceContext class which will accept the object of the Parent class and this can be used for CRUD operations of all the entities. Hope this approach helps! Thanks. ......