Skip to content

Commit 894764d

Browse files
committed
- prevents odata cast virtual properties from generating properties in type
1 parent 2d13cc1 commit 894764d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/GraphODataTemplateWriter/CodeHelpers/Java/TypeHelperJava.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ public static string CreatePackageDefForEntity(this CustomT4Host host)
10511051
var importFormat = @"import {0}.{1}.{2};";
10521052
Dictionary<string, int> uniqueStore = new Dictionary<string, int>();
10531053

1054-
foreach (var property in properties.Where(p => !p.Projection.Type.Name.Equals("Stream")))
1054+
foreach (var property in properties.Where(p => !p.Projection.Type.Name.Equals("Stream") && p.ParentPropertyType == null))
10551055
{
10561056
var propertyType = property.GetTypeString();
10571057
if (property.Type is OdcmPrimitiveType)
@@ -1123,7 +1123,7 @@ public static string CreatePackageDefForEntity(this CustomT4Host host)
11231123

11241124
if (properties != null)
11251125
{
1126-
foreach (var property in properties.Where(p => p.IsCollection() && p.IsNavigation()))
1126+
foreach (var property in properties.Where(p => p.IsCollection() && p.IsNavigation() && p.ParentPropertyType == null))
11271127
{
11281128
if (property.Type is OdcmPrimitiveType)
11291129
continue;
@@ -1336,7 +1336,7 @@ public static string UpdatePropertiesWithinSetRawObject(IEnumerable<OdcmProperty
13361336
var sb = new StringBuilder();
13371337
if (!isComplexType && properties != null)
13381338
{
1339-
foreach (var property in properties.Where(p => p.IsCollection() && p.IsNavigation()))
1339+
foreach (var property in properties.Where(p => p.IsCollection() && p.IsNavigation() && p.ParentPropertyType == null))
13401340
{
13411341
sb.AppendFormat(
13421342
@"
@@ -1429,7 +1429,7 @@ public static string CreatePropertyDef(IEnumerable<OdcmProperty> properties, boo
14291429
14301430
";
14311431

1432-
foreach (var property in properties.Where(p => !p.Projection.Type.Name.Equals("Stream")))
1432+
foreach (var property in properties.Where(p => !p.Projection.Type.Name.Equals("Stream") && p.ParentPropertyType == null))
14331433
{
14341434
var propertyName = property.Name.ToUpperFirstChar();
14351435
var propertyType = "";

0 commit comments

Comments
 (0)