Build an EdmModel thougth below code:
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
EntitySetConfiguration<Employee> employees = builder.EntitySet<Employee>("Employees");
var employee = employees.EntityType;
var actionConfiguration = employee.Action("AddSkill");
actionConfiguration.Parameter<Skill>("skill");
actionConfiguration.ReturnsCollection<Skill>();
return builder.GetEdmModel();
The generated csdl is:
<EnumType Name="Skill" />
but if deleting the 3 lines of adding Action, then the csdl is:
<EnumType Name="Skill">
<Member Name="CSharp" Value="0" />
<Member Name="Sql" Value="1" />
<Member Name="Web" Value="2" />
</EnumType>
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
EntitySetConfiguration<Employee> employees = builder.EntitySet<Employee>("Employees");
var employee = employees.EntityType;
var actionConfiguration = employee.Action("AddSkill");
actionConfiguration.Parameter<Skill>("skill");
actionConfiguration.ReturnsCollection<Skill>();
return builder.GetEdmModel();
The generated csdl is:
<EnumType Name="Skill" />
but if deleting the 3 lines of adding Action, then the csdl is:
<EnumType Name="Skill">
<Member Name="CSharp" Value="0" />
<Member Name="Sql" Value="1" />
<Member Name="Web" Value="2" />
</EnumType>