Vogen icon indicating copy to clipboard operation
Vogen copied to clipboard

Source generate a manifest of types in a project

Open SteveDunn opened this issue 1 year ago • 1 comments

Describe the feature

It's a common scenario to want to iterate over types, for instance, to register in EFCore. Having a manifest generated will make this easier. Something like:

public static class MyProjectManifest : IEnumerable<IVogen>
{
   public static IVogen[] Types { get; }
   ... GetEnumerator() ... => Types.GetEnumerat();
   ...
}

SteveDunn avatar Oct 17 '24 10:10 SteveDunn

The example above won't work as-is, but something similar should make registering everything in an assembly easier.

SteveDunn avatar Oct 19 '24 06:10 SteveDunn

Just looked at this again and there isn't a common IVogen type that would be suitable as a base interface for all value objects. So there's no way to represent a collection of value objects.

I think the best that we can do is generate particular implementations for each scenario, which is what we do for things like System.Text.Json mapping, OpenAPI schema maping, etc.

SteveDunn avatar Oct 31 '24 05:10 SteveDunn