Skip to content

Commit f6a4a7c

Browse files
author
Robert Anderson
committed
Fixing the build warnings. This is a noop since the replacement is effectively doing the exact same thing as was previously being done.
1 parent 0ac3812 commit f6a4a7c

File tree

10 files changed

+41
-36
lines changed

10 files changed

+41
-36
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*.user
99
*.userosscache
1010
*.sln.docstates
11+
*.vs/
1112

1213
# Build results
1314
**/[Dd]ebug/

src/GraphODataTemplateWriter/CodeHelpers/Android/TypeHelperAndroid.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static string GetTypeString(this OdcmParameter parameter)
4848

4949
public static string GetTypeString(this OdcmProperty property)
5050
{
51-
return GetTypeString(property.Type);
51+
return GetTypeString(property.Projection.Type);
5252
}
5353

5454
public static bool IsComplex(this OdcmParameter property)
@@ -76,8 +76,9 @@ public static string SanitizePropertyName(this OdcmObject property)
7676

7777
public static string GetToLowerImport(this OdcmProperty property)
7878
{
79-
var index = property.Type.Name.LastIndexOf('.');
80-
return property.Type.Name.Substring(0, index).ToLower() + property.Type.Name.Substring(index);
79+
var type = property.Projection.Type;
80+
var index = type.Name.LastIndexOf('.');
81+
return type.Name.Substring(0, index).ToLower() + type.Name.Substring(index);
8182
}
8283

8384
}

src/GraphODataTemplateWriter/CodeHelpers/CSharp/TypeHelperCSharp.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,12 @@ public static string GetTypeString(this OdcmType type)
145145

146146
public static string GetTypeString(this OdcmProperty property)
147147
{
148-
return GetTypeString(property.Type);
148+
return GetTypeString(property.Projection.Type);
149149
}
150150

151151
public static bool IsTypeNullable(this OdcmProperty property)
152152
{
153-
var t = property.GetTypeString();
154-
return property.Type.IsTypeNullable();
153+
return property.Projection.Type.IsTypeNullable();
155154
}
156155

157156
public static bool IsTypeNullable(this OdcmType type)
@@ -168,7 +167,7 @@ public static bool IsByteArray(this OdcmProperty property)
168167

169168
public static bool IsComplex(this OdcmProperty property)
170169
{
171-
return property.Type.IsComplex();
170+
return property.Projection.Type.IsComplex();
172171
}
173172

174173
public static bool IsComplex(this OdcmParameter property)
@@ -217,8 +216,9 @@ public static string GetSanitizedPropertyName(this string property, string prefi
217216

218217
public static string GetToLowerImport(this OdcmProperty property)
219218
{
220-
var index = property.Type.Name.LastIndexOf('.');
221-
return property.Type.Name.Substring(0, index).ToLower() + property.Type.Name.Substring(index);
219+
var type = property.Projection.Type;
220+
var index = type.Name.LastIndexOf('.');
221+
return type.Name.Substring(0, index).ToLower() + type.Name.Substring(index);
222222
}
223223
}
224224
}

src/GraphODataTemplateWriter/CodeHelpers/JavaScript/CodeWriterJavaScript.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public IEnumerable<OdcmProperty> EntityNavigationProperties(OdcmClass obj)
4545

4646
public String FullTypeName(OdcmProperty prop)
4747
{
48-
return (prop.IsCollection) ? "Collection(" + prop.Type.FullName + ")" : prop.Type.FullName;
48+
var fullName = prop.Projection.Type.FullName;
49+
return (prop.IsCollection) ? "Collection(" + fullName + ")" : fullName;
4950
}
5051
}
5152

src/GraphODataTemplateWriter/CodeHelpers/JavaScript/TypeHelperJavaScript.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static string GetTypeString(this OdcmParameter parameter)
4747

4848
public static string GetTypeString(this OdcmProperty property)
4949
{
50-
return GetTypeString(property.Type);
50+
return GetTypeString(property.Projection.Type);
5151
}
5252

5353
public static bool IsComplex(this OdcmParameter property)
@@ -75,8 +75,9 @@ public static string SanitizePropertyName(this OdcmObject property)
7575

7676
public static string GetToLowerImport(this OdcmProperty property)
7777
{
78-
var index = property.Type.Name.LastIndexOf('.');
79-
return property.Type.Name.Substring(0, index).ToLower() + property.Type.Name.Substring(index);
78+
var type = property.Projection.Type;
79+
var index = type.Name.LastIndexOf('.');
80+
return type.Name.Substring(0, index).ToLower() + type.Name.Substring(index);
8081
}
8182

8283
}

src/GraphODataTemplateWriter/CodeHelpers/ObjC/CodeWriterObjC.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public string GetImportsClass(IEnumerable<OdcmProperty> references, IEnumerable<
122122
var imports = new StringBuilder();
123123
var classes = new StringBuilder("@class ");
124124
var classType = references.First().Class.GetTypeString();
125-
foreach (var type in references.Select(prop => prop.Type).Distinct())
125+
foreach (var type in references.Select(prop => prop.Projection.Type).Distinct())
126126
{
127127
if (type is OdcmEnum)
128128
{

src/GraphODataTemplateWriter/CodeHelpers/ObjC/TypeHelperObjC.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static string GetTypeString(this OdcmType type)
121121

122122
public static string GetTypeString(this OdcmProperty property)
123123
{
124-
return property.Type.GetTypeString();
124+
return property.Projection.Type.GetTypeString();
125125
}
126126

127127
public static bool IsComplex(this OdcmType type)
@@ -133,7 +133,7 @@ public static bool IsComplex(this OdcmType type)
133133

134134
public static bool IsComplex(this OdcmProperty property)
135135
{
136-
return property.Type.IsComplex();
136+
return property.Projection.Type.IsComplex();
137137
}
138138

139139
public static bool IsPrimitive(this OdcmType type)
@@ -163,7 +163,7 @@ public static string GetFullType(this OdcmProperty property)
163163
}
164164
else
165165
{
166-
return property.Type.GetTypeString();
166+
return property.Projection.Type.GetTypeString();
167167
}
168168
}
169169

@@ -174,7 +174,7 @@ public static string GetFullType(this OdcmType type)
174174

175175
public static bool IsSystem(this OdcmProperty property)
176176
{
177-
return property.Type.IsSystem();
177+
return property.Projection.Type.IsSystem();
178178
}
179179

180180
public static bool IsSystem(this OdcmType type)
@@ -185,7 +185,7 @@ public static bool IsSystem(this OdcmType type)
185185

186186
public static bool IsDate(this OdcmProperty prop)
187187
{
188-
return prop.Type.IsDate();
188+
return prop.Projection.Type.IsDate();
189189
}
190190

191191
public static bool IsDate(this OdcmType type)
@@ -201,8 +201,9 @@ public static string GetToLowerFirstCharName(this OdcmProperty property)
201201

202202
public static string GetToLowerImport(this OdcmProperty property)
203203
{
204-
var index = property.Type.Name.LastIndexOf('.');
205-
return property.Type.Name.Substring(0, index).ToLower() + property.Type.Name.Substring(index);
204+
var type = property.Projection.Type;
205+
var index = type.Name.LastIndexOf('.');
206+
return type.Name.Substring(0, index).ToLower() + type.Name.Substring(index);
206207
}
207208

208209
public static string GetToUpperFirstCharName(this OdcmProperty property)
@@ -212,7 +213,7 @@ public static string GetToUpperFirstCharName(this OdcmProperty property)
212213

213214
public static bool IsEnum(this OdcmProperty property)
214215
{
215-
return property.Type is OdcmEnum;
216+
return property.Projection.Type is OdcmEnum;
216217
}
217218
public static string GetNSNumberValueMethod(this OdcmType type)
218219
{

src/GraphODataTemplateWriter/CodeHelpers/Python/TypeHelperPython.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public static string GetTypeString(this OdcmType @type)
4848

4949
public static string GetTypeString(this OdcmParameter parameter)
5050
{
51-
string t = "<class '";
5251
switch (@parameter.Type.Name)
5352
{
5453
case "String":
@@ -78,7 +77,7 @@ public static string GetTypeString(this OdcmParameter parameter)
7877

7978
public static string GetTypeString(this OdcmProperty property)
8079
{
81-
return GetTypeString(property.Type);
80+
return GetTypeString(property.Projection.Type);
8281
}
8382

8483

@@ -92,7 +91,7 @@ public static bool IsComplex(this OdcmType type)
9291

9392
public static bool IsComplex(this OdcmProperty property)
9493
{
95-
return property.Type.IsComplex();
94+
return property.Projection.Type.IsComplex();
9695
}
9796

9897
public static string GetToLowerFirstCharName(this OdcmProperty property)
@@ -110,8 +109,9 @@ public static string SanitizePropertyName(this OdcmProperty property)
110109

111110
public static string GetToLowerImport(this OdcmProperty property)
112111
{
113-
var index = property.Type.Name.LastIndexOf('.');
114-
return property.Type.Name.Substring(0, index).ToLower() + property.Type.Name.Substring(index);
112+
var type = property.Projection.Type;
113+
var index = type.Name.LastIndexOf('.');
114+
return type.Name.Substring(0, index).ToLower() + type.Name.Substring(index);
115115
}
116116

117117
}

src/GraphODataTemplateWriter/Extensions/OdcmModelExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static IEnumerable<OdcmClass> GetEntityReferenceTypes(this OdcmModel mode
8181
// Instead, take the properties that we know are references and not collections and grab the appropriate entity type
8282
// for each, returning those.
8383
var entityTypes = model.GetEntityTypes();
84-
var referencePropertyTypes = model.GetProperties().Where(prop => prop.IsReference() && !prop.IsCollection).Select(prop => prop.Type).Distinct();
84+
var referencePropertyTypes = model.GetProperties().Where(prop => prop.IsReference() && !prop.IsCollection).Select(prop => prop.Projection.Type).Distinct();
8585

8686
var referenceEntityTypes = new List<OdcmClass>();
8787
foreach (var referencePropertyType in referencePropertyTypes)
@@ -102,7 +102,7 @@ public static IEnumerable<OdcmProperty> FilterProperties(IEnumerable<OdcmPropert
102102
var allProperties = properties;
103103
if (typeName != null)
104104
{
105-
allProperties = allProperties.Where(prop => prop.Type.Name.Equals(typeName));
105+
allProperties = allProperties.Where(prop => prop.Projection.Type.Name.Equals(typeName));
106106
}
107107
if (longDescriptionMatches != null)
108108
{
@@ -144,7 +144,7 @@ public static OdcmProperty GetServiceCollectionNavigationPropertyForPropertyType
144144
.Classes
145145
.Where(odcmClass => odcmClass.Kind == OdcmClassKind.Service)
146146
.SelectMany(service => (service as OdcmServiceClass).NavigationProperties())
147-
.Where(property => property.IsCollection && property.Type.FullName.Equals(odcmProperty.Type.FullName))
147+
.Where(property => property.IsCollection && property.Projection.Type.FullName.Equals(odcmProperty.Projection.Type.FullName))
148148
.First();
149149
}
150150

@@ -215,9 +215,9 @@ public static OdcmMethod AsOdcmMethod(this OdcmObject odcmObject)
215215

216216
public static OdcmClass BaseClass(this OdcmObject odcmObject)
217217
{
218-
if (odcmObject.AsOdcmProperty() != null && odcmObject.AsOdcmProperty().Type.AsOdcmClass() != null)
218+
if (odcmObject.AsOdcmProperty() != null && odcmObject.AsOdcmProperty().Projection.Type.AsOdcmClass() != null)
219219
{
220-
var baseClass = odcmObject.AsOdcmProperty().Type.AsOdcmClass().Base;
220+
var baseClass = odcmObject.AsOdcmProperty().Projection.Type.AsOdcmClass().Base;
221221
if (baseClass != null && !baseClass.IsAbstract)
222222
{
223223
return baseClass;
@@ -239,9 +239,9 @@ public static bool HasDerived(this OdcmObject odcmObject)
239239
{
240240
return odcmObject.AsOdcmClass().Derived.Any();
241241
}
242-
else if (odcmObject.AsOdcmProperty() != null && odcmObject.AsOdcmProperty().Type.AsOdcmClass() != null)
242+
else if (odcmObject.AsOdcmProperty() != null && odcmObject.AsOdcmProperty().Projection.Type.AsOdcmClass() != null)
243243
{
244-
return odcmObject.AsOdcmProperty().Type.AsOdcmClass().Derived.Any();
244+
return odcmObject.AsOdcmProperty().Projection.Type.AsOdcmClass().Derived.Any();
245245
}
246246
else if (odcmObject.AsOdcmMethod() != null && odcmObject.AsOdcmMethod().ReturnType.AsOdcmClass() != null)
247247
{

src/GraphODataTemplateWriter/TemplateProcessor/TemplateProcessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ private IEnumerable<TextFile> ProcessProperties(ITemplateInfo templateInfo, Func
189189
.Select(odcmProperty => this.ProcessTemplate(templateInfo, odcmProperty,
190190
className: odcmProperty.Class.Name,
191191
propertyName: odcmProperty.Name,
192-
propertyType: odcmProperty.Type.Name));
192+
propertyType: odcmProperty.Projection.Type.Name));
193193
}
194194

195195
protected virtual IEnumerable<TextFile> ProcessMethods(ITemplateInfo templateInfo, Func<IEnumerable<OdcmMethod>> methods)
@@ -229,7 +229,7 @@ protected virtual IEnumerable<OdcmProperty> CollectionReferenceProperties()
229229

230230
protected virtual IEnumerable<OdcmProperty> CollectionProperties()
231231
{
232-
return this.CurrentModel.GetProperties().Where(prop => prop.IsCollection && !(prop.Type is OdcmPrimitiveType) && !prop.IsReference());
232+
return this.CurrentModel.GetProperties().Where(prop => prop.IsCollection && !(prop.Projection.Type is OdcmPrimitiveType) && !prop.IsReference());
233233
}
234234

235235
protected virtual IEnumerable<OdcmObject> FilterOdcmEnumerable(ITemplateInfo templateInfo, Func<IEnumerable<OdcmObject>> modelMethod)

0 commit comments

Comments
 (0)