Skip to content

Commit 0baf0e4

Browse files
committed
Added actions
1 parent cb95148 commit 0baf0e4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Templates/TypeScript/src/path_list.txt.tt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
CustomT4Host host = (CustomT4Host) Host;
66
CodeWriterTypeScript writer = (CodeWriterTypeScript) host.CodeWriter;
77

8-
var model = host.CurrentModel;
98
var entityTypes = model.GetEntityTypes();
10-
var complexTypes = model.GetComplexTypes();
119
var entitySet = model.EntityContainer.Properties;
1210
#>
1311
<# foreach(var es in entitySet) { #>

src/GraphODataTemplateWriter/CodeHelpers/TypeScript/TypeHelperTypeScript.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,25 @@ public static List<string> GetNavigationPaths(this OdcmProperty prop, string bas
9595
newBase = baseString + "/" + prop.Name;
9696

9797
}
98+
9899
paths.Add(newBase);
99-
100+
if (entity.Methods.Any()) // check for actions
101+
{
102+
foreach (var method in entity.Methods)
103+
{
104+
paths.Add(newBase + "/" + method.Name);
105+
}
106+
}
107+
100108
foreach (var eprop in entity.Properties)
101109
{
102110
if (eprop.IsLink)
103111
{
104112
paths.AddRange(GetNavigationPaths(eprop, newBase, entities, depth + 1));
105113
}
106114
}
115+
116+
107117
return paths;
108118
}
109119

0 commit comments

Comments
 (0)