Sanjay Patel
Sanjay Patel

Reputation: 983

Insert 2 entity value in odata in single post

i have a two entity

Public Class Order
{
Public int Id{get;set;}
public string Name{get; set;}
public List<OrderDetail> {get;set;}
}

Public Class OrderDetail
{
Public int Id{get;set;}
public string Item{get;set;}
public float Amount{get;set;}

public int Order{get;set;
}

and i create asp.net webapi Odata service and i want to insert both table data in single post request

Upvotes: 1

Views: 2413

Answers (1)

Mark Stafford - MSFT
Mark Stafford - MSFT

Reputation: 4336

Batch is a fine suggestion, as is deep insert. See POSTing an entity type with children to an (MVC Web Api) OData service for more details on using deep insert with Web API OData

Upvotes: 2

Related Questions