Skip to content

Commit 4ac5e00

Browse files
author
root
committed
Merge branch 'master' into typescript
2 parents 0767b3d + aa2db60 commit 4ac5e00

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

Templates/ObjC/Base/SharedObjC.template.tt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ private string GetJsonToObjCExpressionConversion(string expr,OdcmProperty prop)
105105
expr);
106106
}
107107

108+
if(GetObjCTypeIdentifier(prop,true)=="MSTimeOfDay")
109+
{
110+
return String.Format(@"[{0} ms_timeFromString: {1}]",
111+
GetObjCTypeIdentifier(prop,true),
112+
expr);
113+
}
114+
108115
if(prop.IsEnum())
109116
{
110117
return String.Format(

Templates/ObjC/Models/Models.h.tt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<#@ include file="SharedObjC.template.tt"#>
44

55
#import "MSDate.h"
6+
#import "MSTimeOfDay.h"
67
<#
78
var enums = model.GetEnumTypes();
89
foreach(var e in enums)

Templates/ObjC/Requests/ODataEntities.h.tt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,6 @@ foreach(var et in entityTypes)
9393

9494
foreach(var complexType in model.GetComplexTypes())
9595
{
96-
foreach(var prop in complexType.GetProperties().Where(prop => prop.IsCollection && !(prop.Projection.Type is OdcmPrimitiveType) && !prop.IsEnum() && !prop.LongDescriptionContains("ignorableCollection")))
97-
{
98-
var baseName = writer.GetPrefix() + prop.Class.Name.ToUpperFirstChar() + prop.Name.ToUpperFirstChar();
99-
if(!prop.IsReference())
100-
{
101-
classes.Add("#import \"" + baseName + "CollectionRequestBuilder.h\"");
102-
classes.Add("#import \"" + baseName + "CollectionRequest.h\"");
103-
}
104-
else
105-
{
106-
classes.Add("#import \"" + baseName + "CollectionWithReferencesRequestBuilder.h\"");
107-
classes.Add("#import \"" + baseName + "CollectionWithReferencesRequest.h\"");
108-
classes.Add("#import \"" + baseName + "CollectionReferenceRequestBuilder.h\"");
109-
classes.Add("#import \"" + baseName + "CollectionReferenceRequest.h\"");
110-
}
111-
}
11296
foreach(var streamProperty in complexType.GetProperties(typeName:"Stream"))
11397
{
11498
classes.Add("#import \"" + writer.GetPrefix() + streamProperty.Class.Name.ToUpperFirstChar() + streamProperty.Name.ToUpperFirstChar() + "Request.h\"");

src/GraphODataTemplateWriter/CodeHelpers/ObjC/TypeHelperObjC.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,18 @@ public static string GetTypeString(this OdcmType type)
108108
return "NSDate";
109109
case "Date":
110110
return "MSDate";
111+
case "TimeOfDay":
112+
return "MSTimeOfDay";
111113
case "Binary":
112114
return "NSString";
113115
case "Boolean":
114116
return "BOOL";
115117
case "Stream":
116118
return "NSStream";
119+
case "Duration":
120+
return "Duration";
121+
case "NSDictionary":
122+
return "NSDictionary";
117123
default:
118124
return Prefix + type.Name.ToUpperFirstChar();
119125
}
@@ -128,7 +134,7 @@ public static bool IsComplex(this OdcmType type)
128134
{
129135
string t = GetTypeString(type);
130136
return
131-
!(t.Contains("int") || t == "BOOL" || t == "Byte" || t == "CGFloat");
137+
!(t == "int32_t" || t == "int64_t" || t == "int16_t" || t == "BOOL" || t == "Byte" || t == "CGFloat");
132138
}
133139

134140
public static bool IsComplex(this OdcmProperty property)

0 commit comments

Comments
 (0)