added message class and added references to server and client projects

This commit is contained in:
Sem van der Hoeven
2020-09-23 11:50:25 +02:00
parent 1041aa0391
commit 28242ff052
5 changed files with 61 additions and 1 deletions

34
Message/Program.cs Normal file
View File

@@ -0,0 +1,34 @@
using Newtonsoft.Json;
using System;
namespace Message
{
public class Message
{
public string Identifier
{
get;set;
}
public string Payload
{
get;set;
}
public Message(string identifier, string payload)
{
this.Identifier = identifier;
this.Payload = payload;
}
public string Serialize()
{
return JsonConvert.SerializeObject(this);
}
public static Message Deserialize(string json)
{
return (Message)JsonConvert.DeserializeObject(json);
}
}
}