diff --git a/Samples/azure-storage/Azure.CSharp/Models/CheckNameAvailabilityResult.cs b/Samples/azure-storage/Azure.CSharp/Models/CheckNameAvailabilityResult.cs
index 3314c73b429a5..20953881f71e9 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/CheckNameAvailabilityResult.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/CheckNameAvailabilityResult.cs
@@ -35,26 +35,23 @@ public CheckNameAvailabilityResult(bool? nameAvailable = default(bool?), Reason?
}
///
- /// Gets or sets gets a boolean value that indicates whether the name
- /// is available for you to use. If true, the name is available. If
- /// false, the name has already been taken or invalid and cannot be
- /// used.
+ /// Gets a boolean value that indicates whether the name is available
+ /// for you to use. If true, the name is available. If false, the
+ /// name has already been taken or invalid and cannot be used.
///
[JsonProperty(PropertyName = "nameAvailable")]
public bool? NameAvailable { get; set; }
///
- /// Gets or sets gets the reason that a storage account name could not
- /// be used. The Reason element is only returned if NameAvailable is
- /// false. Possible values include: 'AccountNameInvalid',
- /// 'AlreadyExists'
+ /// Gets the reason that a storage account name could not be used. The
+ /// Reason element is only returned if NameAvailable is false.
+ /// Possible values include: 'AccountNameInvalid', 'AlreadyExists'
///
[JsonProperty(PropertyName = "reason")]
public Reason? Reason { get; set; }
///
- /// Gets or sets gets an error message explaining the Reason value in
- /// more detail.
+ /// Gets an error message explaining the Reason value in more detail.
///
[JsonProperty(PropertyName = "message")]
public string Message { get; set; }
diff --git a/Samples/azure-storage/Azure.CSharp/Models/CustomDomain.cs b/Samples/azure-storage/Azure.CSharp/Models/CustomDomain.cs
index 780666fbf8397..ae896e09b2af8 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/CustomDomain.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/CustomDomain.cs
@@ -32,8 +32,7 @@ public CustomDomain(string name, bool? useSubDomain = default(bool?))
}
///
- /// Gets or sets gets or sets the custom domain name. Name is the
- /// CNAME source.
+ /// Gets or sets the custom domain name. Name is the CNAME source.
///
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
diff --git a/Samples/azure-storage/Azure.CSharp/Models/Endpoints.cs b/Samples/azure-storage/Azure.CSharp/Models/Endpoints.cs
index 07da02a859814..322405ff212ca 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/Endpoints.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/Endpoints.cs
@@ -36,25 +36,25 @@ public Endpoints(string blob = default(string), string queue = default(string),
}
///
- /// Gets or sets gets the blob endpoint.
+ /// Gets the blob endpoint.
///
[JsonProperty(PropertyName = "blob")]
public string Blob { get; set; }
///
- /// Gets or sets gets the queue endpoint.
+ /// Gets the queue endpoint.
///
[JsonProperty(PropertyName = "queue")]
public string Queue { get; set; }
///
- /// Gets or sets gets the table endpoint.
+ /// Gets the table endpoint.
///
[JsonProperty(PropertyName = "table")]
public string Table { get; set; }
///
- /// Gets or sets gets the file endpoint.
+ /// Gets the file endpoint.
///
[JsonProperty(PropertyName = "file")]
public string File { get; set; }
diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountKeys.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountKeys.cs
index 17fc974d70b0a..0f3109c3ff86e 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountKeys.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountKeys.cs
@@ -31,13 +31,13 @@ public StorageAccountKeys(string key1 = default(string), string key2 = default(s
}
///
- /// Gets or sets gets the value of key 1.
+ /// Gets the value of key 1.
///
[JsonProperty(PropertyName = "key1")]
public string Key1 { get; set; }
///
- /// Gets or sets gets the value of key 2.
+ /// Gets the value of key 2.
///
[JsonProperty(PropertyName = "key2")]
public string Key2 { get; set; }
diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountProperties.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountProperties.cs
index fc6600913fb86..d452949b8b28b 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountProperties.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountProperties.cs
@@ -46,89 +46,87 @@ public StorageAccountProperties(ProvisioningState? provisioningState = default(P
}
///
- /// Gets or sets gets the status of the storage account at the time
- /// the operation was called. Possible values include: 'Creating',
- /// 'ResolvingDNS', 'Succeeded'
+ /// Gets the status of the storage account at the time the operation
+ /// was called. Possible values include: 'Creating', 'ResolvingDNS',
+ /// 'Succeeded'
///
[JsonProperty(PropertyName = "provisioningState")]
public ProvisioningState? ProvisioningState { get; set; }
///
- /// Gets or sets gets the type of the storage account. Possible values
- /// include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS',
- /// 'Standard_RAGRS', 'Premium_LRS'
+ /// Gets the type of the storage account. Possible values include:
+ /// 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS',
+ /// 'Premium_LRS'
///
[JsonProperty(PropertyName = "accountType")]
public AccountType? AccountType { get; set; }
///
- /// Gets or sets gets the URLs that are used to perform a retrieval of
- /// a public blob, queue or table object.Note that StandardZRS and
- /// PremiumLRS accounts only return the blob endpoint.
+ /// Gets the URLs that are used to perform a retrieval of a public
+ /// blob, queue or table object.Note that StandardZRS and PremiumLRS
+ /// accounts only return the blob endpoint.
///
[JsonProperty(PropertyName = "primaryEndpoints")]
public Endpoints PrimaryEndpoints { get; set; }
///
- /// Gets or sets gets the location of the primary for the storage
- /// account.
+ /// Gets the location of the primary for the storage account.
///
[JsonProperty(PropertyName = "primaryLocation")]
public string PrimaryLocation { get; set; }
///
- /// Gets or sets gets the status indicating whether the primary
- /// location of the storage account is available or unavailable.
- /// Possible values include: 'Available', 'Unavailable'
+ /// Gets the status indicating whether the primary location of the
+ /// storage account is available or unavailable. Possible values
+ /// include: 'Available', 'Unavailable'
///
[JsonProperty(PropertyName = "statusOfPrimary")]
public AccountStatus? StatusOfPrimary { get; set; }
///
- /// Gets or sets gets the timestamp of the most recent instance of a
- /// failover to the secondary location. Only the most recent
- /// timestamp is retained. This element is not returned if there has
- /// never been a failover instance. Only available if the accountType
- /// is StandardGRS or StandardRAGRS.
+ /// Gets the timestamp of the most recent instance of a failover to
+ /// the secondary location. Only the most recent timestamp is
+ /// retained. This element is not returned if there has never been a
+ /// failover instance. Only available if the accountType is
+ /// StandardGRS or StandardRAGRS.
///
[JsonProperty(PropertyName = "lastGeoFailoverTime")]
public DateTime? LastGeoFailoverTime { get; set; }
///
- /// Gets or sets gets the location of the geo replicated secondary for
- /// the storage account. Only available if the accountType is
- /// StandardGRS or StandardRAGRS.
+ /// Gets the location of the geo replicated secondary for the storage
+ /// account. Only available if the accountType is StandardGRS or
+ /// StandardRAGRS.
///
[JsonProperty(PropertyName = "secondaryLocation")]
public string SecondaryLocation { get; set; }
///
- /// Gets or sets gets the status indicating whether the secondary
- /// location of the storage account is available or unavailable. Only
- /// available if the accountType is StandardGRS or StandardRAGRS.
- /// Possible values include: 'Available', 'Unavailable'
+ /// Gets the status indicating whether the secondary location of the
+ /// storage account is available or unavailable. Only available if
+ /// the accountType is StandardGRS or StandardRAGRS. Possible values
+ /// include: 'Available', 'Unavailable'
///
[JsonProperty(PropertyName = "statusOfSecondary")]
public AccountStatus? StatusOfSecondary { get; set; }
///
- /// Gets or sets gets the creation date and time of the storage
- /// account in UTC.
+ /// Gets the creation date and time of the storage account in UTC.
///
[JsonProperty(PropertyName = "creationTime")]
public DateTime? CreationTime { get; set; }
///
- /// Gets or sets gets the user assigned custom domain assigned to this
- /// storage account.
+ /// Gets the user assigned custom domain assigned to this storage
+ /// account.
///
[JsonProperty(PropertyName = "customDomain")]
public CustomDomain CustomDomain { get; set; }
///
- /// Gets or sets gets the URLs that are used to perform a retrieval of
- /// a public blob, queue or table object from the secondary location
- /// of the storage account. Only available if the accountType is
+ /// Gets the URLs that are used to perform a retrieval of a public
+ /// blob, queue or table object from the secondary location of the
+ /// storage account. Only available if the accountType is
/// StandardRAGRS.
///
[JsonProperty(PropertyName = "secondaryEndpoints")]
diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesCreateParameters.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesCreateParameters.cs
index 15c2ee2251e39..444ed779e21e5 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesCreateParameters.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesCreateParameters.cs
@@ -28,9 +28,9 @@ public StorageAccountPropertiesCreateParameters(AccountType accountType)
}
///
- /// Gets or sets gets or sets the account type. Possible values
- /// include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS',
- /// 'Standard_RAGRS', 'Premium_LRS'
+ /// Gets or sets the account type. Possible values include:
+ /// 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS',
+ /// 'Premium_LRS'
///
[JsonProperty(PropertyName = "accountType")]
public AccountType AccountType { get; set; }
diff --git a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesUpdateParameters.cs b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesUpdateParameters.cs
index 13be2a2b7c05d..c71d99adb09af 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesUpdateParameters.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/StorageAccountPropertiesUpdateParameters.cs
@@ -30,9 +30,9 @@ public StorageAccountPropertiesUpdateParameters(AccountType? accountType = defau
}
///
- /// Gets or sets gets or sets the account type. Note that StandardZRS
- /// and PremiumLRS accounts cannot be changed to other account types,
- /// and other account types cannot be changed to StandardZRS or
+ /// Gets or sets the account type. Note that StandardZRS and
+ /// PremiumLRS accounts cannot be changed to other account types, and
+ /// other account types cannot be changed to StandardZRS or
/// PremiumLRS. Possible values include: 'Standard_LRS',
/// 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS'
///
diff --git a/Samples/azure-storage/Azure.CSharp/Models/Usage.cs b/Samples/azure-storage/Azure.CSharp/Models/Usage.cs
index 55e8efea0849a..2eb06b5a0f561 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/Usage.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/Usage.cs
@@ -35,29 +35,28 @@ public Usage(UsageUnit unit, int currentValue, int limit, UsageName name)
}
///
- /// Gets or sets gets the unit of measurement. Possible values
- /// include: 'Count', 'Bytes', 'Seconds', 'Percent',
- /// 'CountsPerSecond', 'BytesPerSecond'
+ /// Gets the unit of measurement. Possible values include: 'Count',
+ /// 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'
///
[JsonProperty(PropertyName = "unit")]
public UsageUnit Unit { get; set; }
///
- /// Gets or sets gets the current count of the allocated resources in
- /// the subscription.
+ /// Gets the current count of the allocated resources in the
+ /// subscription.
///
[JsonProperty(PropertyName = "currentValue")]
public int CurrentValue { get; set; }
///
- /// Gets or sets gets the maximum count of the resources that can be
- /// allocated in the subscription.
+ /// Gets the maximum count of the resources that can be allocated in
+ /// the subscription.
///
[JsonProperty(PropertyName = "limit")]
public int Limit { get; set; }
///
- /// Gets or sets gets the name of the type of usage.
+ /// Gets the name of the type of usage.
///
[JsonProperty(PropertyName = "name")]
public UsageName Name { get; set; }
diff --git a/Samples/azure-storage/Azure.CSharp/Models/UsageName.cs b/Samples/azure-storage/Azure.CSharp/Models/UsageName.cs
index 358acbc355e45..dfbea3e135b2d 100644
--- a/Samples/azure-storage/Azure.CSharp/Models/UsageName.cs
+++ b/Samples/azure-storage/Azure.CSharp/Models/UsageName.cs
@@ -31,13 +31,13 @@ public UsageName(string value = default(string), string localizedValue = default
}
///
- /// Gets or sets gets a string describing the resource name.
+ /// Gets a string describing the resource name.
///
[JsonProperty(PropertyName = "value")]
public string Value { get; set; }
///
- /// Gets or sets gets a localized string describing the resource name.
+ /// Gets a localized string describing the resource name.
///
[JsonProperty(PropertyName = "localizedValue")]
public string LocalizedValue { get; set; }
diff --git a/src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdHeaders.cs b/src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdHeaders.cs
index 72111ec242963..f37e469b5f85e 100644
--- a/src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdHeaders.cs
+++ b/src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdHeaders.cs
@@ -38,7 +38,7 @@ public HeaderCustomNamedRequestIdHeaders(string fooRequestId = default(string))
}
///
- /// Gets or sets gets the foo-request-id.
+ /// Gets the foo-request-id.
///
[JsonProperty(PropertyName = "foo-request-id")]
public string FooRequestId { get; set; }
diff --git a/src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdParamGroupingHeaders.cs b/src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdParamGroupingHeaders.cs
index 187e76f91c07b..180d37057b419 100644
--- a/src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdParamGroupingHeaders.cs
+++ b/src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/Models/HeaderCustomNamedRequestIdParamGroupingHeaders.cs
@@ -38,7 +38,7 @@ public HeaderCustomNamedRequestIdParamGroupingHeaders(string fooRequestId = defa
}
///
- /// Gets or sets gets the foo-request-id.
+ /// Gets the foo-request-id.
///
[JsonProperty(PropertyName = "foo-request-id")]
public string FooRequestId { get; set; }
diff --git a/src/generator/AutoRest.CSharp/ClientModelExtensions.cs b/src/generator/AutoRest.CSharp/ClientModelExtensions.cs
index 486a1091ee2df..faf83b945610c 100644
--- a/src/generator/AutoRest.CSharp/ClientModelExtensions.cs
+++ b/src/generator/AutoRest.CSharp/ClientModelExtensions.cs
@@ -150,21 +150,28 @@ public static string GetFormattedPropertySummary(this Property property)
return null;
}
- string documentation = property.IsReadOnly ? "Gets " : "Gets or sets ";
+ string documentation = String.Empty;
string summary = string.IsNullOrEmpty(property.Summary) ? property.Documentation : property.Summary;
- string firstWord = summary.TrimStart().Split(' ').First();
- if (firstWord.Length <= 1)
+ if (summary.TrimStart().StartsWith("Gets ", StringComparison.OrdinalIgnoreCase))
{
- documentation += char.ToLower(summary[0], CultureInfo.InvariantCulture) + summary.Substring(1);
+ documentation = summary;
}
else
{
- documentation += firstWord.ToUpper(CultureInfo.InvariantCulture) == firstWord
- ? summary
- : char.ToLower(summary[0], CultureInfo.InvariantCulture) + summary.Substring(1);
+ documentation = property.IsReadOnly ? "Gets " : "Gets or sets ";
+ string firstWord = summary.TrimStart().Split(' ').First();
+ if (firstWord.Length <= 1)
+ {
+ documentation += char.ToLower(summary[0], CultureInfo.InvariantCulture) + summary.Substring(1);
+ }
+ else
+ {
+ documentation += firstWord.ToUpper(CultureInfo.InvariantCulture) == firstWord
+ ? summary
+ : char.ToLower(summary[0], CultureInfo.InvariantCulture) + summary.Substring(1);
+ }
}
-
return documentation.EscapeXmlComment();
}