aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-06-02 07:26:58 -0500
committerJP Dillingham <jp@dillingham.me>2022-06-02 07:26:58 -0500
commitcbffe2d38e5b7b0831eeacff7ba1ef7973f4f85c (patch)
treed1ef0c0720b562f0261dbac47fe32d71c8219bfa
parentf3b2e02168e77ea8cc9bc68d151aba56e279f9c4 (diff)
downloadslskd-cbffe2d38e5b7b0831eeacff7ba1ef7973f4f85c.tar.gz
add serialization constructor
-rw-r--r--src/slskd/Shares/Domain/Share.cs23
1 files changed, 23 insertions, 0 deletions
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;
/// <summary>
@@ -28,6 +29,28 @@ namespace slskd.Shares
/// <summary>
/// Initializes a new instance of the <see cref="Share"/> class.
/// </summary>
+ /// <param name="id"></param>
+ /// <param name="alias"></param>
+ /// <param name="isExcluded"></param>
+ /// <param name="localPath"></param>
+ /// <param name="mask"></param>
+ /// <param name="raw"></param>
+ /// <param name="remotePath"></param>
+ [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;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="Share"/> class.
+ /// </summary>
/// <param name="share"></param>
public Share(string share)
{