Skip to content

Question: Using Alternate keys when inserting, updating entities #908

Open
@swidz

Description

I wonder if it is possible to send POST (inserts) using alternate keys on navigation properties like this:

url: /api/data/v8.2/contacts
method: POST
body: {
	"firstname" : "john",
	"lastname" : "smith",
	"parentcustomerid_account@odata.bind" : "/accounts(blg_alternatekey='blg12345')"
}

I am currently using class model which is converted to dictionary by standard functionality so the json being generated is like this

url: /api/data/v8.2/contacts
method: POST
body: {
	"firstname" : "john",
	"lastname" : "smith",
	"parentcustomerid_account@odata.bind" : "/accounts(00000000-0000-0000-0000-000000000001)"
}

Would it be possible to still using class model but force to use alternate key instead of navigation property's entity key ?

Regards,
Sebastian

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions