Hi, I’m new NetworkComms.net and so far, I really like it.
I need to send a collection of objects. Basically a file list.
So I created a FileDetails object
[ProtoContract]
[JsonObject(MemberSerialization.OptIn)]
public class FileDetails
{
[ProtoMember(1)]
[JsonProperty]
public string FileName { get; set; }
…
}
but I don’t know the best way to send a List<FileDetails> or honestly ANY way to send them.
I tried
…
public List<FileDetails> _files;
[ProtoMember(4, OverwriteList = true)]
private IEnumerable<FileDetails> Files
{
get { return _files; }
set
{
_files = new List<FileDetails>();
_files.AddRange(value);
}
}
…
but when I sent the message, the connection at the other end closes.
I looked thru your sample code and didn’t find a collection inside a message anywhere.
Can you point me in the right direction?
thanks