-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved #4905: Allow to add converters to the standard JSON serializer
- Loading branch information
Showing
7 changed files
with
70 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
using Volo.Abp.Modularity; | ||
using Volo.Abp.Json.Newtonsoft; | ||
using Volo.Abp.Modularity; | ||
using Volo.Abp.Timing; | ||
|
||
namespace Volo.Abp.Json | ||
{ | ||
[DependsOn(typeof(AbpTimingModule))] | ||
public class AbpJsonModule : AbpModule | ||
{ | ||
|
||
public override void ConfigureServices(ServiceConfigurationContext context) | ||
{ | ||
Configure<AbpNewtonsoftJsonSerializerOptions>(options => | ||
{ | ||
options.Converters.Add<AbpJsonIsoDateTimeConverter>(); | ||
}); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
framework/src/Volo.Abp.Json/Volo/Abp/Json/Newtonsoft/AbpNewtonsoftJsonSerializerOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Newtonsoft.Json; | ||
using Volo.Abp.Collections; | ||
|
||
namespace Volo.Abp.Json.Newtonsoft | ||
{ | ||
public class AbpNewtonsoftJsonSerializerOptions | ||
{ | ||
public ITypeList<JsonConverter> Converters { get; } | ||
|
||
public AbpNewtonsoftJsonSerializerOptions() | ||
{ | ||
Converters = new TypeList<JsonConverter>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters