Skip to content

Commit 455f177

Browse files
authored
Updates EntityRequestBuilder.Base.template.tt
Updates EntityRequestBuilder.Base.template.tt so that it does not create properties with the same name as the methods within the class (specifically request), by concatenating a "_" to the end of the property name.
1 parent 02288c4 commit 455f177

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Templates/CSharp/Base/EntityRequestBuilder.Base.template.tt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ public string GetRequestBuilderProperty(string propertyName, string urlValue, st
142142

143143
public string GetCollectionPropertyRequestBuilderProperty(string entityName, OdcmProperty odcmProperty)
144144
{
145-
var propertyName = this.GetPropertyName(odcmProperty).GetSanitizedPropertyName();
145+
var propertyName = this.GetPropertyName(odcmProperty);
146+
propertyName = propertyName.GetSanitizedPropertyName(suffix: propertyName == "Request" ? "_" : null);
146147
var propertyPrefix = string.Concat(entityName, this.GetPropertyName(odcmProperty));
147148
var collectionRequestBuilder = odcmProperty.IsReference()
148149
? this.GetCollectionWithReferencesRequestBuilderString(propertyPrefix)
@@ -153,7 +154,8 @@ public string GetCollectionPropertyRequestBuilderProperty(string entityName, Odc
153154

154155
public string GetNonCollectionRequestBuilderProperty(OdcmProperty odcmProperty)
155156
{
156-
var propertyName = this.GetPropertyName(odcmProperty).GetSanitizedPropertyName();
157+
var propertyName = this.GetPropertyName(odcmProperty);
158+
propertyName = propertyName.GetSanitizedPropertyName(suffix: propertyName == "Request" ? "_" : null);
157159
var propertyPrefix = this.GetPropertyTypeName(odcmProperty);
158160
var propertyRequestBuilder = odcmProperty.IsReference()
159161
? this.GetWithReferenceRequestBuilderString(propertyPrefix)

0 commit comments

Comments
 (0)