Skip to content

Commit e27e5b6

Browse files
committed
Pass default endpoint URL via config
1 parent 34ca886 commit e27e5b6

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Templates/CSharp/Requests/EntityClient.cs.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ namespace <#=entityContainer.Namespace.GetNamespaceName()#>
2222
public <#=clientName#>(
2323
IAuthenticationProvider authenticationProvider,
2424
IHttpProvider httpProvider = null)
25-
: this("https://graph.microsoft.com/v1.0", authenticationProvider, httpProvider)
25+
: this(<#=ConfigurationService.Settings.DefaultBaseEndpointUrl#>, authenticationProvider, httpProvider)
2626
{
2727
}
2828

2929
/// <summary>
3030
/// Instantiates a new <#=clientName#>.
3131
/// </summary>
32-
/// <param name="baseUrl">The base service URL. For example, "https://graph.microsoft.com/v1.0."</param>
32+
/// <param name="baseUrl">The base service URL. For example, "<#=ConfigurationService.Settings.DefaultBaseEndpointUrl#>"</param>
3333
/// <param name="authenticationProvider">The <see cref="IAuthenticationProvider"/> for authenticating request messages.</param>
3434
/// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending requests.</param>
3535
public <#=clientName#>(

src/GraphODataTemplateWriter/.config/TemplateWriterSettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"TemplatesDirectory": "../../../../Templates",
1111
"DefaultFileCasing": "UpperCamel",
1212
"CustomFlags": [ "python2" ],
13+
"DefaultBaseEndpointUrl": "https://graph.microsoft.com/v1.0",
1314
"LicenseHeader": [
1415
"Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information."
1516
],

src/GraphODataTemplateWriter/Settings/TemplateWriterSettings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public TemplateWriterSettings()
2929
this.TemplatesDirectory = null;
3030
this.DefaultFileCasing = "UpperCamel";
3131
this.CustomFlags = new List<string>();
32+
this.DefaultBaseEndpointUrl = "https://graph.microsoft.com/v1.0";
3233
}
3334

3435
public void CopyPropertiesFromMainSettings()
@@ -76,6 +77,8 @@ public Dictionary<string, List<Dictionary<string, string>>> TemplateMapping
7677
/// </summary>
7778
public string DefaultFileCasing;
7879

80+
public string DefaultBaseEndpointUrl { get; set; }
81+
7982
public IList<string> CustomFlags { get; set; }
8083

8184
public IList<string> Plugins { get; set; }

0 commit comments

Comments
 (0)