Skip to content

Commit 3a0ba5e

Browse files
author
Caitlin Bales (MSFT)
committed
Fix primitive type case
Also added bool as a switch case. This updates methods with return types of "String" to now return "string".
1 parent aa08288 commit 3a0ba5e

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Templates/CSharp/Requests/IMethodRequest.cs.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var isComposable = method.IsComposable;
1313
var methodName = method.Name.Substring(method.Name.IndexOf('.') + 1).ToCheckedCase();
1414
var requestType = entityName + methodName + "Request";
1515

16-
var returnEntityType = method.ReturnType == null ? null : method.ReturnType.Name.GetTypeString().ToCheckedCase();
16+
var returnEntityType = method.ReturnType == null ? null : method.ReturnType.Name.ToCheckedCase().GetTypeString();
1717
var returnEntityParameter = string.Empty;
1818
if (returnEntityType != null) {returnEntityParameter = returnEntityType.ToLower();}
1919
var returnTypeObject = method.ReturnType == null ? null : method.ReturnType.AsOdcmClass();

Templates/CSharp/Requests/MethodRequest.cs.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var isComposable = method.IsComposable;
1313
var methodName = method.Name.Substring(method.Name.IndexOf('.') + 1).ToCheckedCase();
1414
var requestType = entityName + methodName + "Request";
1515

16-
var returnEntityType = method.ReturnType == null ? null : method.ReturnType.Name.GetTypeString().ToCheckedCase();
16+
var returnEntityType = method.ReturnType == null ? null : method.ReturnType.Name.ToCheckedCase().GetTypeString();
1717
var returnEntityParameter = string.Empty;
1818
if (returnEntityType != null) {returnEntityParameter = returnEntityType.ToLower();}
1919

src/GraphODataTemplateWriter/CodeHelpers/CSharp/TypeHelperCSharp.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public static string GetTypeString(this string type)
138138
case "binary":
139139
return "byte[]";
140140
case "boolean":
141+
case "bool":
141142
return "bool";
142143
case "date":
143144
return "Date";

0 commit comments

Comments
 (0)