Removed IJsonOutputFormatter

This commit is contained in:
Ajay Bhargav Baaskaran 2015-06-22 10:47:25 -07:00
parent 5632a33098
commit f206cf6759
3 changed files with 13 additions and 22 deletions

View File

@ -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
{
}
}

View File

@ -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;

View File

@ -130,7 +130,7 @@ namespace Microsoft.AspNet.Mvc
.GetRequiredService<IOptions<MvcOptions>>()
.Options
.OutputFormatters
.OfType<IJsonOutputFormatter>()
.OfType<JsonOutputFormatter>()
.ToArray();
var formatter = objectResult.SelectFormatter(formatterContext, formatters);