Home > Developing Using CodeFluent Entities > Custom Sub Producer Example

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:

  • CodeFluent.Model.dll
  • CodeFluent.Model.Common.dll
  • CodeFluent.Producers.CodeDom.dll

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.

 

Cheers,

Thibault NESTOR

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s