Skip to content

Commit 94b89c9

Browse files
committed
Duration
1 parent 1531c52 commit 94b89c9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/GraphODataTemplateWriter/CodeHelpers/CSharp/TypeHelperCSharp.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ public static string GetTypeString(this OdcmType type, string namespaceContext,
167167
{
168168
var typesNamespace = type.Namespace.GetNamespaceName().Replace("edm.", "");
169169
var plainTypeString = type.GetTypeString();
170+
171+
// refer to core implementation when they are available for Edm types
172+
var coreModelTypes = new List<string> { "Duration", "TimeOfDay" }; // TODO list not complete.
173+
if (typesNamespace == "Edm" && coreModelTypes.Contains(plainTypeString))
174+
{
175+
typesNamespace = "Microsoft.Graph";
176+
}
177+
170178
if (format != null)
171179
{
172180
plainTypeString = string.Format(format, plainTypeString);

0 commit comments

Comments
 (0)