Add AspNet GenericExtensions
This commit is contained in:
parent
9d87c47f1c
commit
d80c1ac5a0
|
@ -0,0 +1,21 @@
|
|||
using System.Text.Json;
|
||||
|
||||
namespace CC_Functions.AspNet
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for various types
|
||||
/// </summary>
|
||||
public static class GenericExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Include CCF json extensions for this serializer
|
||||
/// </summary>
|
||||
/// <param name="options">The options to include CCF in</param>
|
||||
/// <returns>The options including CCF</returns>
|
||||
public static JsonSerializerOptions AddCcf(this JsonSerializerOptions options)
|
||||
{
|
||||
options.Converters.Add(new DictionaryGuidConverter());
|
||||
return options;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue