From dc1b2246671749a9b4eaf64bd356877ff4e08b48 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Mon, 28 Feb 2022 17:30:17 -0700 Subject: Add JsonConstructor --- MediaBrowser.Model/Session/GeneralCommand.cs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Model') diff --git a/MediaBrowser.Model/Session/GeneralCommand.cs b/MediaBrowser.Model/Session/GeneralCommand.cs index 29528c110..757b19b31 100644 --- a/MediaBrowser.Model/Session/GeneralCommand.cs +++ b/MediaBrowser.Model/Session/GeneralCommand.cs @@ -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()) + { + } + + [JsonConstructor] + public GeneralCommand(Dictionary arguments) { - public GeneralCommand() - { - Arguments = new Dictionary(); - } + Arguments = arguments; + } - public GeneralCommandType Name { get; set; } + public GeneralCommandType Name { get; set; } - public Guid ControllingUserId { get; set; } + public Guid ControllingUserId { get; set; } - public Dictionary Arguments { get; } - } + public Dictionary Arguments { get; } } -- cgit v1.2.3