simple.odata.client - Simple OData Client Unlink -


i have 2 entities - training , certificates. training can have 0, 1, or more certificates. cannot figure out how unlink 2 entities using simple.odata.client. able link 2 entities using following code:

 var client = new odataclient(odataurl);         var x = odatadynamic.expression;          var training = await client             .for(x.trainings)             .key(2382)             .findentryasync();          var certificate = await client             .for(x.certificates)             .key(1)             .findentryasync();          await client             .for(x.trainings)             .key(training)             .linkentryasync(x.certificate, certificate); 

that calls function in trainingscontroller following definition:

public async task<ihttpactionresult> createref([fromodatauri] int key, string navigationproperty, [frombody] uri link) 

that part works fine.

i have tried numerous ways use simple.odata unlink entities. 1 method is:

 var client = new odataclient(odataurl);         var x = odatadynamic.expression;          var training = await client             .for(x.trainings)             .key(2382)             .findentryasync();          var certificate = await client             .for(x.certificates)             .key(1)             .findentryasync();          await client            .for(x.trainings)            .key(training)            .unlinkentryasync(x.certificate, certificate); 

but code not call deleteref function following definition:

public async task<ihttpactionresult> deleteref([fromodatauri] int key, string relatedkey, string navigationproperty) 

the deleteref function definition correct though because if call http://localhost:49937/trainings(2382)/certificates/$ref?$id=http://localhost:49937/certificates(1) postman unlinks 2 entities.

this error when trying call unlink code web page.

enter image description here

any appreciated.

thanks.

brian


Comments

Popular posts from this blog

linux - Could not find a package configuration file provided by "Qt5Svg" -