Skip to content

Commit 02288c4

Browse files
authored
Updates IEntityRequestBuilder.Base.template.tt
Updates IEntityRequestBuilder.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 62156a2 commit 02288c4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Templates/CSharp/Base/IEntityRequestBuilder.Base.template.tt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ public string GetRequestBuilderProperty(string propertyName, string requestBuild
9898
}
9999

100100
public string GetCollectionPropertyRequestBuilderProperty(string entityName, OdcmProperty odcmProperty)
101-
{
102-
var propertyName = this.GetPropertyName(odcmProperty).GetSanitizedPropertyName();
101+
{
102+
var propertyName = this.GetPropertyName(odcmProperty);
103+
propertyName = propertyName.GetSanitizedPropertyName(suffix: propertyName == "Request" ? "_" : null);
103104
var propertyPrefix = string.Concat(entityName, this.GetPropertyName(odcmProperty));
104105
var collectionRequestBuilder = odcmProperty.IsReference()
105106
? this.GetCollectionWithReferencesRequestBuilderString(propertyPrefix)
@@ -110,7 +111,8 @@ public string GetCollectionPropertyRequestBuilderProperty(string entityName, Odc
110111

111112
public string GetNonCollectionRequestBuilderProperty(OdcmProperty odcmProperty)
112113
{
113-
var propertyName = this.GetPropertyName(odcmProperty).GetSanitizedPropertyName();
114+
var propertyName = this.GetPropertyName(odcmProperty);
115+
propertyName = propertyName.GetSanitizedPropertyName(suffix: propertyName == "Request" ? "_" : null);
114116
var propertyPrefix = this.GetPropertyTypeName(odcmProperty);
115117
var propertyRequestBuilder = odcmProperty.IsReference()
116118
? this.GetWithReferenceRequestBuilderString(propertyPrefix)

0 commit comments

Comments
 (0)