According to OData spec, we cannot have duplicate function names for Actions within a container. Notice that in the below example, the action "UpdateName" is present twice
"MUST not have a declaring EntityContainer that declares another FunctionImport with the same Name. This means that actions MUST NOT have overloads."
Model
--------
ODataModelBuilder modelBuilder = new ODataConventionModelBuilder();
modelBuilder.ComplexType<Address>();
var products = modelBuilder.EntitySet<Product>("Products");
var productFamilies =modelBuilder.EntitySet<ProductFamily>("ProductFamilies");
var suppliers = modelBuilder.EntitySet<Supplier>("Suppliers");
var updateNameAction1 = products.EntityType.Action("UpdateName");
updateNameAction1.Parameter<string>("newName");
var updateNameAction2 = suppliers.EntityType.Action("UpdateName");
updateNameAction2.Parameter<string>("newName");
Metadata
-----------
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="Default">
<EntityContainer Name="Container">
<EntitySet Name="Products" EntityType="ODataService.Models.Product"/>
<EntitySet Name="ProductFamilies" EntityType="ODataService.Models.ProductFamily"/>
<EntitySet Name="Suppliers" EntityType="ODataService.Models.Supplier"/>
<FunctionImport Name="UpdateName" IsBindable="true">
<Parameter Name="bindingParameter" Type="ODataService.Models.Product"/>
<Parameter Name="newName" Type="Edm.String" FixedLength="false" Unicode="false"/>
</FunctionImport>
<FunctionImport Name="UpdateName" IsBindable="true">
<Parameter Name="bindingParameter" Type="ODataService.Models.Supplier"/>
<Parameter Name="newName" Type="Edm.String" FixedLength="false" Unicode="false"/>
</FunctionImport>
Comments: The latest OData protocol actually allows action overloads that differ from binding parameters.
"MUST not have a declaring EntityContainer that declares another FunctionImport with the same Name. This means that actions MUST NOT have overloads."
Model
--------
ODataModelBuilder modelBuilder = new ODataConventionModelBuilder();
modelBuilder.ComplexType<Address>();
var products = modelBuilder.EntitySet<Product>("Products");
var productFamilies =modelBuilder.EntitySet<ProductFamily>("ProductFamilies");
var suppliers = modelBuilder.EntitySet<Supplier>("Suppliers");
var updateNameAction1 = products.EntityType.Action("UpdateName");
updateNameAction1.Parameter<string>("newName");
var updateNameAction2 = suppliers.EntityType.Action("UpdateName");
updateNameAction2.Parameter<string>("newName");
Metadata
-----------
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="Default">
<EntityContainer Name="Container">
<EntitySet Name="Products" EntityType="ODataService.Models.Product"/>
<EntitySet Name="ProductFamilies" EntityType="ODataService.Models.ProductFamily"/>
<EntitySet Name="Suppliers" EntityType="ODataService.Models.Supplier"/>
<FunctionImport Name="UpdateName" IsBindable="true">
<Parameter Name="bindingParameter" Type="ODataService.Models.Product"/>
<Parameter Name="newName" Type="Edm.String" FixedLength="false" Unicode="false"/>
</FunctionImport>
<FunctionImport Name="UpdateName" IsBindable="true">
<Parameter Name="bindingParameter" Type="ODataService.Models.Supplier"/>
<Parameter Name="newName" Type="Edm.String" FixedLength="false" Unicode="false"/>
</FunctionImport>
Comments: The latest OData protocol actually allows action overloads that differ from binding parameters.