Current Situation

At the moment, we are not able to create directly typed instances out the generated Source as in DatenMeister.Wrapper.

Solution

During Source Code Generation, we add one static method into each class according the following principle:

public class XXX_Wrapper
{
   public static XXX_Wrapper Create(IFactory factory)
   {
       return new XXX_Wrapper(factory.create(_metaclass reference_));
   }
}

The metaclass reference is available within the Shadow objects.

Steps

  • ✓ Create Feature Branch 'feature/source_generator_for_factories'

  • ✓ Update Source Generator

  • ✓ Check on example

  • ✓ Create Unittest

  • ✓ Merge

Let’s start