소스 검색

Merge pull request #7380 from crobibero/general-command

Bond-009 3 년 전
부모
커밋
2dbb32976c
1개의 변경된 파일16개의 추가작업 그리고 10개의 파일을 삭제
  1. 16 10
      MediaBrowser.Model/Session/GeneralCommand.cs

+ 16 - 10
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<string, string>())
+    {
+    }
+
+    [JsonConstructor]
+    public GeneralCommand(Dictionary<string, string> arguments)
     {
-        public GeneralCommand()
-        {
-            Arguments = new Dictionary<string, string>();
-        }
+        Arguments = arguments;
+    }
 
-        public GeneralCommandType Name { get; set; }
+    public GeneralCommandType Name { get; set; }
 
-        public Guid ControllingUserId { get; set; }
+    public Guid ControllingUserId { get; set; }
 
-        public Dictionary<string, string> Arguments { get; }
-    }
+    public Dictionary<string, string> Arguments { get; }
 }