Skip to content

Fixed spacing indentation #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions Templates/CSharp/Base/EntityRequest.Base.template.tt
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ public void AppendUpdateAsyncHeader(string entityName, string lowerCaseEntityNam
{
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" /// <param name=\"cancellationToken\">The <see cref=\"CancellationToken\"/> for the request.</param>");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" /// <exception cref=\"ClientException\">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" /// <exception cref=\"ClientException\">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>");
}

stringBuilder.Append(Environment.NewLine);
Expand Down Expand Up @@ -419,6 +419,32 @@ public string GetEntityUpdateAsyncMethod(OdcmClass odcmClass, bool initializeCol
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" }");
stringBuilder.Append(Environment.NewLine);
stringBuilder.AppendFormat(" if ({0}ToUpdate.AdditionalData != null)", lowerCaseEntityName);
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" {");
stringBuilder.Append(Environment.NewLine);
stringBuilder.AppendFormat(" if ({0}ToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||", lowerCaseEntityName);
stringBuilder.Append(Environment.NewLine);
stringBuilder.AppendFormat(" {0}ToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))", lowerCaseEntityName);
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" {");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" throw new ClientException(");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" new Error");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" {");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" Code = GeneratedErrorConstants.Codes.NotAllowed,");
stringBuilder.Append(Environment.NewLine);
stringBuilder.AppendFormat(" Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, {0}ToUpdate.GetType().Name)", lowerCaseEntityName);
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" });");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" }");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" }");
stringBuilder.Append(Environment.NewLine);
stringBuilder.AppendFormat(" this.ContentType = \"{0}\";", templateWriter.jsonContentType);
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" this.Method = \"PATCH\";");
Expand Down
6 changes: 3 additions & 3 deletions Templates/CSharp/Base/IEntityRequest.Base.template.tt
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ public void AppendUpdateAsyncMethodHeader(string entityName, string lowerCaseEnt
{
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" /// <param name=\"cancellationToken\">The <see cref=\"CancellationToken\"/> for the request.</param>");
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" /// <exception cref=\"ClientException\">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>");
}
stringBuilder.Append(Environment.NewLine);
stringBuilder.Append(" /// <exception cref=\"ClientException\">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>");
}

stringBuilder.Append(Environment.NewLine);
stringBuilder.AppendFormat(" /// <returns>The updated {0}.</returns>", entityName);
Expand Down