data-builder-generator icon indicating copy to clipboard operation
data-builder-generator copied to clipboard

Are you open to PRs for this project?

Open BrianMcBrayer opened this issue 3 years ago • 1 comments

I’m a software developer who was going to write some C# code generators for a fluent dto builder, and I saw your data-builder-generator which is very similar.

Instead of me writing my own to match my particular needs, would you be open to me opening some PRs to extend yours?

  • I’ve found a few small bugs (possible) where VS doesn’t like internal classes decorated with the GenerateDataBuilder attribute
  • I’d like to add an assembly-level attribute that can be used to specify a file to generate the data builder for (so instead of decorating a class, you could put these attributes somewhere else, like a test project, if you only use the builder pattern to test DTOs and don’t want to put the attribute on prod code). Maybe something like the following?
[GenerateDataBuilderFor(nameof(MyAssembly.MyClass), generatedNamespace: $"{nameof(MyAssembly.MyClass)}.Tests")]
  • I’d like to extend the collection-level builder so that one could add single items to ICollection<T>. So... with the following class:
[GenerateDataBuilder]
public class Family
{
    public List<string> FamilyMember { get; set; }
}

The builder would have the following method WithFamilyMember(string familyMember) that would add a single string to the list.

BrianMcBrayer avatar Mar 28 '21 19:03 BrianMcBrayer

Yes if you'd like to extend the functionality and fix some issues, I'd be happy to work with you to get these out.

As I previously mentioned in https://github.com/dasMulli/data-builder-generator/issues/3, I wanted to hold off a bit waiting for good practices in source generators to emerge before refactoring / working on more features since it does what I need it to do. But again, if you need any extensions, no need to wait.

dasMulli avatar Mar 28 '21 19:03 dasMulli