Skip to content

Commit 7736cd0

Browse files
committed
Overloads for OData Actions / Functions
1 parent 75860bd commit 7736cd0

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Templates/ObjC/Requests/EntityRequestBuilder.h.tt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,15 @@ foreach(var prop in entity.Properties.Where( prop => prop.Projection.Type is Odc
193193

194194
<#
195195
}
196+
197+
var allMethods = new List<OdcmMethod>();
196198
foreach(var func in entity.Methods)
199+
{
200+
allMethods.Add(func);
201+
allMethods.AddRange(func.Overloads);
202+
}
203+
204+
foreach(var func in allMethods)
197205
{
198206
var methodName = func.Name.Substring(func.Name.IndexOf('.') + 1).ToLowerFirstChar();
199207
var requestBuilderName = writer.GetPrefix() + entity.Name.ToUpperFirstChar() + methodName.ToUpperFirstChar() + "RequestBuilder";
@@ -204,8 +212,6 @@ foreach(var func in entity.Methods)
204212
#>
205213
- (<#=requestBuilderName#> *)<#=methodName#>;
206214

207-
208-
209215
<#
210216

211217
}

Templates/ObjC/Requests/EntityRequestBuilder.m.tt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,14 @@ foreach(var prop in entity.Properties.Where( prop => prop.Projection.Type is Odc
115115

116116
}
117117

118+
var allMethods = new List<OdcmMethod>();
118119
foreach(var func in entity.Methods)
120+
{
121+
allMethods.Add(func);
122+
allMethods.AddRange(func.Overloads);
123+
}
124+
125+
foreach(var func in allMethods)
119126
{
120127
var methodName = func.Name.Substring(func.Name.IndexOf('.') + 1).ToLowerFirstChar();
121128
var requestBuilderName = writer.GetPrefix() + entity.Name.ToUpperFirstChar() + methodName.ToUpperFirstChar() + "RequestBuilder";

0 commit comments

Comments
 (0)