Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

aelij/ImmutableCollections.Serialization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Serialization helpers for System.Collections.Immutable

Collections in System.Collections.Immutable are not serializable. This library provides serializable wrappers for the collections, which allow using them as-is, while efficiently serializing and deserializing them (when possible, using a Builder).

NuGet

Usage

[DataContract]
public class ImmutableData
{
	[DataMember]
	private readonly ImmutableListSerializable<int> _list = new ImmutableListSerializable<int>();
	
	public ImmutableList<int> List
	{
		get => _list.Value;
		private set => _list.Value = value;
	}
	
	public ImmutableData WithList(ImmutableList<int> list)
	{
		return new ImmutableData { List = list };
	}
}

About

Serialization helpers for System.Collections.Immutable

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages