Import entities from local storage when using ASP.NET WebApi OData not loading extra metadata

StackOverflow https://stackoverflow.com/questions/23490131

  •  16-07-2023
  •  | 
  •  

When I try to save imported entities from local storage it thrown exception here.

    var extraMetadata = aspect.extraMetadata;
    var uri = extraMetadata.uri || extraMetadata.id;
    if (core.stringStartsWith(uri, baseUri)) {
        uri = routePrefix + uri.substring(baseUri.length);
    }
    request.requestUri = uri;
    if (extraMetadata.etag) {
        request.headers["If-Match"] = extraMetadata.etag;
    }

But if I get data from OData service directly it is saving correctly. Anything I am missing when importing data from local storage. I tried this solution but it didn't help me.

有帮助吗?

解决方案

This is a bug we are tracking (#2574). I was hoping we'd fix it for v.1.4.12 but it looks like it will have to wait a cycle.

There is no good workaround. You can try to remember the extraMetadata yourself (in some sideband storage) and re-attach it when you re-import. Not fun I know. Sorry.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top