Uno.CodeGen icon indicating copy to clipboard operation
Uno.CodeGen copied to clipboard

Generate helpers for immutable collections/dictionaries

Open carldebilly opened this issue 6 years ago • 0 comments

Feature request

Should generate helpers to manage collections and dictionaries on immutable entities.

Example

Declaration

  [GeneratedImmutable]
  public class MyClass
  {
    public ImmutableArray<string> Favorites { get; }
    public ImmutableDictionary<string, string> Settings { get; }
  }

Usage

  public void Do()
  {
    var a = new MyClass();
    var b = a.WithAddFavorite("ID01");
    var c = b.WithSetting("owner", "uno platform");
  }

Features

  • Should support implementations of IImmutableList<T>, IImmutableSet<T>, IImmutableQueue<T>, IImmutableStack<T>, IImmutableDictionary<TKey, TValue>.
  • Should handle null

carldebilly avatar Feb 25 '19 19:02 carldebilly