Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc committed Dec 27, 2024
1 parent afcdfa7 commit 2cf40f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions sandbox/GeneratorSandbox/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
//using Microsoft.Extensions.Options;
//using ZLogger;



//args = ["echo", "--msg", "zzzz"];

//// IHostBuilder
Expand Down Expand Up @@ -145,6 +147,11 @@ namespace ConsoleAppFramework
{
internal static partial class ConsoleApp
{
static void Foo()
{
var options = JsonSerializerOptions ?? System.Text.Json.JsonSerializerOptions.Default;
}

//public static ConsoleAppBuilder Create(IServiceProvider serviceProvider)
//{
// ConsoleApp.ServiceProvider = serviceProvider;
Expand Down
3 changes: 2 additions & 1 deletion src/ConsoleAppFramework/ConsoleAppBaseCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ static bool TrySplitParse<T>(ReadOnlySpan<char> s, out T[] result)
{
try
{
var type = (System.Text.Json.Serialization.Metadata.JsonTypeInfo<T[]>)JsonSerializerOptions.GetTypeInfo(typeof(T))!;
var options = JsonSerializerOptions ?? System.Text.Json.JsonSerializerOptions.Default;
var type = (System.Text.Json.Serialization.Metadata.JsonTypeInfo<T[]>)options.GetTypeInfo(typeof(T[]))!;
result = System.Text.Json.JsonSerializer.Deserialize<T[]>(s, type)!;
return true;
}
Expand Down

0 comments on commit 2cf40f2

Please sign in to comment.