Skip to content

Commit 0b784b1

Browse files
authored
Add Nest.Utf8Json using directives to razor files (#5243)
When generating code for NEST the code had numerous errors due to missing using statements. This PR fixes this for master.
1 parent 41ed813 commit 0b784b1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@inherits CodeTemplatePage<KeyValuePair<string, ReadOnlyCollection<ApiEndpoint>>>
77
@{
88
KeyValuePair<string, ReadOnlyCollection<ApiEndpoint>> model = Model;
9-
string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null;
9+
string ns = model.Key != CsharpNames.RootNamespace ? "." + CsharpNames.ApiNamespace + "." + model.Key + CsharpNames.ApiNamespaceSuffix : null;
1010
var endpoints = model.Value;
1111
}
1212
@{ await IncludeAsync("GeneratorNotice.cshtml", Model); }
@@ -16,12 +16,13 @@ using System.Collections.Generic;
1616
using System.Linq;
1717
using System.Text;
1818
using System.Linq.Expressions;
19+
using Nest.Utf8Json;
1920

2021
using Elasticsearch.Net;
2122
@if (model.Key != CsharpNames.RootNamespace)
2223
{
2324
<text>using Elasticsearch.Net@(ns);
24-
</text>
25+
</text>
2526
}
2627

2728
// ReSharper disable RedundantBaseConstructorCall

src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@inherits CodeTemplatePage<KeyValuePair<string, ReadOnlyCollection<ApiEndpoint>>>
77
@{
88
KeyValuePair<string, ReadOnlyCollection<ApiEndpoint>> model = Model;
9-
string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null;
9+
string ns = model.Key != CsharpNames.RootNamespace ? "." + CsharpNames.ApiNamespace + "." + model.Key + CsharpNames.ApiNamespaceSuffix : null;
1010
var endpoints = model.Value;
1111
}
1212
@{ await IncludeAsync("GeneratorNotice.cshtml", Model); }
@@ -18,10 +18,11 @@ using System.Text;
1818
using System.Linq.Expressions;
1919
using System.Runtime.Serialization;
2020
using Elasticsearch.Net;
21+
using Nest.Utf8Json;
2122
@if (model.Key != CsharpNames.RootNamespace)
2223
{
2324
<text>using Elasticsearch.Net@(ns);
24-
</text>
25+
</text>
2526
}
2627

2728
// ReSharper disable RedundantBaseConstructorCall

0 commit comments

Comments
 (0)