m31coding / M31.FluentAPI

Generate fluent builders for your C# classes with ease.
MIT License
94 stars 4 forks source link

Feature: Allow inheritance #29

Open vzam opened 2 months ago

vzam commented 2 months ago

I currently have a use case where I created an abstract builder which receives a bunch of type parameters and the idea is that it would be possible to inherit from that builder and specify some of those type parameters. This would allow to have a generic implementation of a builder and a few ones which are very specific to their use case and project:

// no FluentApi
public abstract class GenericBuilder<T>
{
  [FluentMember]
  public T Content { get; set; }
}

[FluentApi]
public class ConcreteBuilder : GenericBuilder<int>

var builder = CreateConcreteBuilder.WithContent(1);
m31coding commented 1 month ago

Thank you for your request! Inheritance is the next feature I would like to look into.

Best regards, Kevin