From cbffe2d38e5b7b0831eeacff7ba1ef7973f4f85c Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 2 Jun 2022 07:26:58 -0500 Subject: add serialization constructor --- src/slskd/Shares/Domain/Share.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src') diff --git a/src/slskd/Shares/Domain/Share.cs b/src/slskd/Shares/Domain/Share.cs index 464ab074..9bdbc002 100644 --- a/src/slskd/Shares/Domain/Share.cs +++ b/src/slskd/Shares/Domain/Share.cs @@ -18,6 +18,7 @@ namespace slskd.Shares { using System.Linq; + using System.Text.Json.Serialization; using System.Text.RegularExpressions; /// @@ -25,6 +26,28 @@ namespace slskd.Shares /// public sealed class Share { + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// + [JsonConstructor] + public Share (string id, string alias, bool isExcluded, string localPath, string mask, string raw, string remotePath) + { + Id = id; + Alias = alias; + IsExcluded = isExcluded; + LocalPath = localPath; + Mask = mask; + Raw = raw; + RemotePath = remotePath; + } + /// /// Initializes a new instance of the class. /// -- cgit v1.2.3