c# - Azure Table Storage Query from IronPython -


i've got project uses ironpython scripting engine perform various tasks. 1 of tasks needs table lookup's on azure table storage, table layouts different, , change often, need model classes defined in python.

here problem i'm running into, whenever run query complains base class project not supported client library.

unhandled exception: system.invalidoperationexception: type 'ironpython.newtypes.iptest.basemodelclass_1$1' not supported client library. 

python code:

import clr import system clr.addreference("system.core") clr.importextensions(system.linq)   class mytable(azuretableservice.basemodelclass):     def __new__(self, partitionkey, rowkey):         self.partitionkey = partitionkey         self.rowkey = rowkey         return super.__new__(self)      mytabledetails = "";  #i can manually create entity, , recognizes base class, not when try return query #working = mytable("10", "10040") #print working.partitionkey  y = azuretableservice.getazuretablequery[mytable]("mytable") z = y.where(lambda c: c.partitionkey == "10" , c.rowkey == "10040")  print(z.single()) 

c# code:

public class azuretableservice {     private cloudstorageaccount mstorageaccount;     public azuretableservice() {         cloudstorageaccount.setconfigurationsettingpublisher((configname, configsetter) => {             var connectionstring = configurationmanager.appsettings[configname];             configsetter(connectionstring);         });         mstorageaccount = cloudstorageaccount.fromconfigurationsetting("dataconnectionstring");             }      private tableservicecontext azuretableservicecontext {         {             var context = mstorageaccount.createcloudtableclient().getdataservicecontext();             context.ignoreresourcenotfoundexception = true;             return context;         }     }     public iqueryable<t> getazuretablequery<t>(string tablename) {         return azuretableservicecontext.createquery<t>(tablename);     }      public class basemodelclass : tableserviceentity {         public basemodelclass(string partitionkey, string rowkey) : base(partitionkey, rowkey) { }         public basemodelclass() : base(guid.newguid().tostring(), string.empty) { }     } } 

is there obvious i'm missing? in commented code, seems recognize base class properties when manually create it, not when try returning query.

the problem facing related system.data.services.client used microsoft.windowsazure.storageclient.

it restricts types can used in data services client. seems prevent implementation of idynamicmetaobjectprovider (basically dynamic object , therefore object of ironpython class) used during deserialization of query result.

i tested scenario using azure storage 1.7.0.0, 2.0.6.0 , 2.1.0.0-rc confirming results.

you have @ the source , see if deserializer atompub used.


Comments