Removed IJsonOutputFormatter
This commit is contained in:
parent
5632a33098
commit
f206cf6759
|
|
@ -1,20 +0,0 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
namespace Microsoft.AspNet.Mvc
|
||||
{
|
||||
/// <summary>
|
||||
/// An output formatter that specializes in writing JSON content.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The <see cref="JsonResult"/> class filter the collection of
|
||||
/// <see cref="MvcOptions.OutputFormatters"/> and use only those which implement
|
||||
/// <see cref="IJsonOutputFormatter"/>.
|
||||
///
|
||||
/// To create a custom formatter that can be used by <see cref="JsonResult"/>, derive from
|
||||
/// <see cref="JsonOutputFormatter"/> or implement <see cref="IJsonOutputFormatter"/>.
|
||||
/// </remarks>
|
||||
public interface IJsonOutputFormatter : IOutputFormatter
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,18 @@ using Newtonsoft.Json;
|
|||
|
||||
namespace Microsoft.AspNet.Mvc
|
||||
{
|
||||
public class JsonOutputFormatter : OutputFormatter, IJsonOutputFormatter
|
||||
/// <summary>
|
||||
/// An output formatter that specializes in writing JSON content.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The <see cref="JsonResult"/> class filter the collection of
|
||||
/// <see cref="MvcOptions.OutputFormatters"/> and use only those of type
|
||||
/// <see cref="JsonOutputFormatter"/>.
|
||||
///
|
||||
/// To create a custom formatter that can be used by <see cref="JsonResult"/>, derive from
|
||||
/// <see cref="JsonOutputFormatter"/>.
|
||||
/// </remarks>
|
||||
public class JsonOutputFormatter : OutputFormatter
|
||||
{
|
||||
private JsonSerializerSettings _serializerSettings;
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ namespace Microsoft.AspNet.Mvc
|
|||
.GetRequiredService<IOptions<MvcOptions>>()
|
||||
.Options
|
||||
.OutputFormatters
|
||||
.OfType<IJsonOutputFormatter>()
|
||||
.OfType<JsonOutputFormatter>()
|
||||
.ToArray();
|
||||
|
||||
var formatter = objectResult.SelectFormatter(formatterContext, formatters);
|
||||
|
|
|
|||
Loading…
Reference in New Issue