eager loading - Web Api Returning Json - [System.NotSupportedException] Specified method is not supported. (Sybase Ase) -
i'm using web api entity framework 4.2 , sybase ase connector.
this working without issues returning json, until tried add new table.
return db.car .include("tires") .include("tires.hub_caps") .include("tires.hub_caps.colors") .include("tires.hub_caps.sizes") .include("tires.hub_caps.sizes.units") .where(c => c.tires == 13);
the above works without issues if following line removed:
.include("tires.hub_caps.colors")
however, when line included, given error:
""an error occurred while preparing command definition. see inner exception details."
the inner exception reads: "innerexception = {"specified method not supported."}" "source = sybase.adonet4.aseclient"
the following results in error:
list<car> cars = db.car.asnotracking() .include("tires") .include("tires.hub_caps") .include("tires.hub_caps.colors") .include("tires.hub_caps.sizes") .include("tires.hub_caps.sizes.units") .where(c => c.tires == 13).tolist();
the error follows:
an exception of type 'system.data.entitycommandcompilationexception' occurred in system.data.entity.dll not handled in user code additional information: error occurred while preparing command definition. see inner exception details.
inner exception: "specified method not supported."
this points fault with sybase ase data connector.
i using data annotations on tables control fields returned. on colors table, have tried following annotations limit properties returned key:
[jsonignore] [ignoredatamember]
any ideas might causing issue?
alternatively, if keep colors in , remove,
.include("tires.hub_caps.sizes") .include("tires.hub_caps.sizes.units")
then works also. seems sybase ase connector not support cases when include statement forks 1 object in 2 directions. there way round this? same issue occurs sybase ase , progress data connector.
the issue not occur in standard asp.net mvc controller class - problem serializing 2 1 many relationships on single table json.
this issue still occurs if lazy loading turned on.
it seems me bug sybase ase, none of connectors able solve.
Comments
Post a Comment