Add JsonConstructor

This commit is contained in:
Cody Robibero 2022-02-28 17:30:17 -07:00
parent e26446f9c0
commit dc1b224667
1 changed files with 18 additions and 12 deletions

View File

@ -2,20 +2,26 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace MediaBrowser.Model.Session
namespace MediaBrowser.Model.Session;
public class GeneralCommand
{
public class GeneralCommand
public GeneralCommand()
: this(new Dictionary<string, string>())
{
public GeneralCommand()
{
Arguments = new Dictionary<string, string>();
}
public GeneralCommandType Name { get; set; }
public Guid ControllingUserId { get; set; }
public Dictionary<string, string> Arguments { get; }
}
[JsonConstructor]
public GeneralCommand(Dictionary<string, string> arguments)
{
Arguments = arguments;
}
public GeneralCommandType Name { get; set; }
public Guid ControllingUserId { get; set; }
public Dictionary<string, string> Arguments { get; }
}