ApiSystem: System.Text.Json

This commit is contained in:
pavelbannov 2020-07-09 11:08:42 +03:00
parent 5988855b61
commit feba6bb1c0
3 changed files with 10 additions and 6 deletions

View File

@ -82,7 +82,7 @@ namespace ASC.ApiSystem.Controllers
SettingsManager settingsManager,
ApiSystemHelper apiSystemHelper,
CommonMethods commonMethods,
HostedSolution hostedSolution,
IOptionsSnapshot<HostedSolution> hostedSolutionOptions,
CoreSettings coreSettings,
TenantDomainValidator tenantDomainValidator,
UserFormatter userFormatter,
@ -98,7 +98,7 @@ namespace ASC.ApiSystem.Controllers
SettingsManager = settingsManager;
ApiSystemHelper = apiSystemHelper;
CommonMethods = commonMethods;
HostedSolution = hostedSolution;
HostedSolution = hostedSolutionOptions.Value;
CoreSettings = coreSettings;
TenantDomainValidator = tenantDomainValidator;
UserFormatter = userFormatter;

View File

@ -50,12 +50,12 @@ namespace ASC.ApiSystem.Controllers
private ILog Log { get; }
public TariffController(
CommonMethods commonMethods,
HostedSolution hostedSolution,
IOptionsSnapshot<HostedSolution> hostedSolutionOptions,
IOptionsMonitor<ILog> option
)
{
CommonMethods = commonMethods;
HostedSolution = hostedSolution;
HostedSolution = hostedSolutionOptions.Value;
Log = option.Get("ASC.ApiSystem");
}

View File

@ -59,8 +59,12 @@ namespace ASC.ApiSystem
services.AddHttpContextAccessor();
services.AddControllers()
.AddNewtonsoftJson();
services.AddControllers()
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.WriteIndented = false;
options.JsonSerializerOptions.IgnoreNullValues = true;
});
services.AddMemoryCache();