Custom Sub Producer Example
There are several ways to add custom code to the generated code. You could simply do it by using Partial classes (which would be a manual action), Snippets or Aspects. But what if you wanted to add custom code to a specific layer such as the Business Object Layer right before production? Well you would need to create your own Sub Producer.
Creating your own custom Sub Producers in CodeFluent Entities is pretty straightforward: all you have to do is to:
1. create a Class Library project referencing the following assemblies:
2. create a class implementing the ICodeDomSubProducer interface.
3. build and Deploy the Class Library to the CodeFluent current directory (%ProgramFiles%\SoftFluent\CodeFluent\Modeler).
Everything is documented here with examples: Developing a Custom Sub-Producer.
Besides, since it easier to understand something we can actually see running, you’ll find a sample project to play with based on real world code on our forum: Ninject dependency injection.