in Set
Change the entity set for this entity.
Having a non-null entity set is optional if only one entity set in the DataService uses the entity type,
but is required (before DataService.createEntity is called) if multiple entity sets use the same entity type.
- Example using proxy classes:
open fun createInSetExample(): kotlin.Unit { val service = this.service; val customer = Customer(); customer.companyName = "Voyager Inc."; customer.contactName = "Kathryn Janeway"; service.createEntity(customer.inSet(NorthwindService.customers)); }
- Example using dynamic API:
open fun createInSetExample(): kotlin.Unit { val service = this.service; val customersEntitySet = service.getEntitySet("Customers"); val customerEntityType = customersEntitySet.entityType; val companyNameProperty = customerEntityType.getProperty("CompanyName"); val contactNameProperty = customerEntityType.getProperty("ContactName"); val customer = EntityValue.ofType(customerEntityType); companyNameProperty.setString(customer, "Voyager Inc."); contactNameProperty.setString(customer, "Kathryn Janeway"); service.createEntity(customer.inSet(customersEntitySet)); }
Return
This entity.
Parameters
set
Entity set.