In the below example, Customer has 'Id' property. So, we need to create a Customer entity type rather than a complex type.
Type:
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
}
ODataModelBuilder modelBuilder = new ODataConventionModelBuilder();
var products = modelBuilder.EntitySet<Product>("Products");
var productFamilies = modelBuilder.EntitySet<ProductFamily>("ProductFamilies");
var suppliers = modelBuilder.EntitySet<Supplier>("Suppliers");
ActionConfiguration extendSupportAction = new ActionConfiguration(modelBuilder, "ExtendSupport");
extendSupportAction.Parameter<int>("id");
extendSupportAction.Parameter<DateTime>("newDate");
extendSupportAction.Returns<Customer>();
Metadata:
<ComplexType Name="Customer">
<Property Name="Id" Type="Edm.Int32" Nullable="false"/>
<Property Name="Name" Type="Edm.String"/>
</ComplexType>