c# - Azure Storage Client v4.1 - a value of the non-primitive type was expected -
i've upgraded asp.net project (mvc5) target azure sdk 2.3 storage library 4.1 , encountering strange error when try save table storage.
error:
an unhandled exception of type 'microsoft.windowsazure.storage.storageexception' occurred in microsoft.windowsazure.storage.dll
additional information: primitive value specified; however, value of non-primitive type '' expected.
my models go table storage via repositories use tableservicecontext
add, update, delete, save.
i follow pattern models:
[system.data.services.common.dataservicekey(new string[] { "partitionkey", "rowkey" })] public class persistedalert : alert, itableentity { public string partitionkey { { return this.studentid; } set { this.studentid = value; } } public string rowkey { { return this.id; } set { this.id = value; } } public datetime timestamp { get; set; } public new int type { get; set; } //hides enum type in alert base class }
during upgrade needed swap out of references
system.data.services.*
for
microsoft.data.services.*
...in addition odata libraries.
has changed internally makes pattern no longer valid?
since there's nothing (yet) on error on net, , pretty place it's discussed, i'll add solution though context different yours. error same guess originates same place.
for me, inherited primary key caused problem. primary key of serialized entity has natural , not overriden. if class has id property, derivedclass have declare id property "new", or id property has moved class derivedclass.
here's more detail: http://jerther.blogspot.ca/2014/12/aspnet-odata-v4-primitive-value-was.html
i believe bug , not limitation inherited key works entity framework , fluent api.
i hope helps , saves hair pulling.
Comments
Post a Comment