Skip to content

Add Nest.Utf8Json using directives to razor files #5243

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 1 commit into from
Jan 7, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@inherits CodeTemplatePage<KeyValuePair<string, ReadOnlyCollection<ApiEndpoint>>>
@{
KeyValuePair<string, ReadOnlyCollection<ApiEndpoint>> model = Model;
string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null;
string ns = model.Key != CsharpNames.RootNamespace ? "." + CsharpNames.ApiNamespace + "." + model.Key + CsharpNames.ApiNamespaceSuffix : null;
var endpoints = model.Value;
}
@{ await IncludeAsync("GeneratorNotice.cshtml", Model); }
Expand All @@ -16,12 +16,13 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using Nest.Utf8Json;

using Elasticsearch.Net;
@if (model.Key != CsharpNames.RootNamespace)
{
<text>using Elasticsearch.Net@(ns);
</text>
</text>
}

// ReSharper disable RedundantBaseConstructorCall
Expand Down
5 changes: 3 additions & 2 deletions src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@inherits CodeTemplatePage<KeyValuePair<string, ReadOnlyCollection<ApiEndpoint>>>
@{
KeyValuePair<string, ReadOnlyCollection<ApiEndpoint>> model = Model;
string ns = model.Key != CsharpNames.RootNamespace ? "."+CsharpNames.ApiNamespace+"." + model.Key + CsharpNames.ApiNamespaceSuffix : null;
string ns = model.Key != CsharpNames.RootNamespace ? "." + CsharpNames.ApiNamespace + "." + model.Key + CsharpNames.ApiNamespaceSuffix : null;
var endpoints = model.Value;
}
@{ await IncludeAsync("GeneratorNotice.cshtml", Model); }
Expand All @@ -18,10 +18,11 @@ using System.Text;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using Elasticsearch.Net;
using Nest.Utf8Json;
@if (model.Key != CsharpNames.RootNamespace)
{
<text>using Elasticsearch.Net@(ns);
</text>
</text>
}

// ReSharper disable RedundantBaseConstructorCall
Expand Down