unoplatform / Uno.CodeGen

A set of source generators for equality, immutability, ...
Other
90 stars 11 forks source link

Generate helpers for immutable collections/dictionaries #102

Open carldebilly opened 5 years ago

carldebilly commented 5 years ago

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