From a527d40a6071b67bc76f08dd86f0367a7634de4c Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Thu, 7 Jan 2021 10:19:41 +0000 Subject: [PATCH] Add Nest.Utf8Json using directives to razor files When generating code for NEST the code had numerous errors due to missing using statements. This PR fixes this for master. --- .../Views/HighLevel/Descriptors/Descriptors.cshtml | 5 +++-- src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml index 2b5349fca1e..e55cb897dfb 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptors.cshtml @@ -6,7 +6,7 @@ @inherits CodeTemplatePage>> @{ KeyValuePair> 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); } @@ -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) { using Elasticsearch.Net@(ns); - + } // ReSharper disable RedundantBaseConstructorCall diff --git a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml index 94d26fb1af9..e5ea7cb370b 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml @@ -6,7 +6,7 @@ @inherits CodeTemplatePage>> @{ KeyValuePair> 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); } @@ -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) { using Elasticsearch.Net@(ns); - + } // ReSharper disable RedundantBaseConstructorCall