Author Archive

What’s new with CodeFluent Entities 770?

CodeFluent Entities provides several producers allowing you to generate your persistence layer on several database engines. The previous build includes numerous new features such as the support of Microsoft SQL Server 2014.


Once again, the CodeFluent Entities 2014 – Build 770 introduces the support of a new relational database management system: MariaDB. It is a community-developed fork of MySQL created in 2009 which includes some new improvements that (some claim) make it better than MySQL.

Our latest build improves the MySQL producer and now supports MariaDB. The producer supports MariaDB 5.1 and above and relies on the MySQL Connector for .NET version The producer will try to load dynamically the MySql.Data assembly so you might need to copy the MySql.Data.dll in your CodeFluent Entities installation directory if you don’t want to register the MySQL Connector in the GAC.

MariaDB Producer

Below, you can see a generated MariaDB according to the ContactManager CodeFluent Entities Sample Model:

MariaDB Generated

Note that you might need to reference the CodeFluent Runtime.dll and CodeFluent.Runtime.MySQL.dll if you generate the C# Business Object Layer (CodeDom Producer).

CodeFluent Entities 2014 – Build 770 also includes numerous bug fixes and new features. The full list is available here. Yesterday, we published a post that talk about a new feature: How to compress or extract CAB archives. Feel free to read it!

If you have any questions or comments, please share them below.

Happy downloading!

The R&D Team

How to compress or extract CAB archives?

Today, on the series “Exploring the CodeFluent Runtime” we’re going to explore how to compress or extract CAB archives.

Cabinet (or CAB) is an archive file format for Windows that supports lossless data compression and embedded digital certificates used for maintaining archive integrity. Cabinet files have .cab file name extensions.

First, we have to add a reference to “CodeFluent.Runtime.dll”. The namespace we’ll use is “CodeFluent.Runtime.Compression”, the same as for compressing or extracting ZIP file.

One of the biggest advantage compare to ZIP file, is that it can work in memory or by using the file system as it uses Stream. The second point is you don’t have to add a native DLL: it’s all managed. While it’s less efficient than a native implementation, it’s easier to deploy.

Here’s an example to compress one file and a directory:

using (MemoryStream stream = new MemoryStream())
    using (CabFile file = new CodeFluent.Runtime.Compression.CabFile(stream, CabFileMode.Compress))
        file.CompressionLevel = CabCompressionLevel.Maximum;

Extracting files is as simple as compressing.

using (CabFile file = new CodeFluent.Runtime.Compression.CabFile(stream, CabFileMode.Decompress))
    file.EntryExtracted += (sender, e) =>

And there’s more…

We add a method to determine the compression method (CAB or ZIP) of a file. This method can use the file extension if available or the first four bytes of the file (i.e. magic number):

CompressionUtilities.SniffFileFormat("", useExtensionAsHint: true) == CompressionFileFormat.Cab

And that’s not all, in the previous article, we wrote about how to sign a file by using the runtime. CAB file can also be signed, so let sign it:

X509Certificate2 certificate = Authenticode.FindSuitableCertificate(); 
Authenticode.SignFile(certificate, "", null, "SoftFluent");

Cab properties

Happy compressing and signing,

The R&D Team

Exploring the CodeFluent Runtime: Authenticode

Today, on the series “Exploring the CodeFluent Runtime” we’re going to explore how to sign an application with Authenticode method.

Microsoft Authenticode, which is based on industry standards, allows developers to include information about themselves and their code with their programs through the use of digital signatures. Authenticode allows software vendors to sign:

  • .cab files
  • .cat files
  • .ctl files
  • .dll files
  • .exe files
  • .ocx files

First we need a certificate that allows Code Signing. If you haven’t one, let’s create a self-signed one:

REM May change depending of your installed Windows SDK
cd "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin"

REM Generate the root certificate
.\makecert.exe -r -pe -n "CN=Sample.CA" -ss CA -sr CurrentUser -a sha1 -cy authority -sky signature -sv d:\Sample.CA.pvk d:\Sample.CA.cer

REM Add the Root certificate to the user store
certutil.exe -user -addstore Root d:\Sample.CA.cer

REM Create the certificate for code signing
.\makecert.exe -pe -n "CN=Sample.CodeSigning" -eku "," -a sha1 -cy end -sky signature -ic d:\Sample.CA.cer -iv d:\Sample.CA.pvk -sv d:\Sample.CodeSigning.pvk d:\Sample.CodeSigning.cer

REM Convert to certificate to pfx file format
.\pvk2pfx.exe -pvk d:\Sample.CodeSigning.pvk -spc d:\Sample.CodeSigning.cer -pfx d:\Sample.CodeSigning.pfx

We can now sign a file. Add the “CodeFluent.Runtime.dll” reference and use the following code:

X509Certificate2 certificate = Authenticode.FindSuitableCertificate();
Authenticode.SignFile(certificate, "sample.exe", null, "SoftFluent");

The first line find a valid certificate for code signing in the user certificate store. If none is found, it returns null.

The second line signs the file. You have to indicate:

  • the certificate to use
  • the file to sign
  • the timestamp server
  • the display name

If you look at the file properties, you’ll find a new tab ‘Digital Signature’ which contains details about the signer.

Digital Signature

Please note:

  • you don’t need to provide a password, nor a path to the certificate => Generic, simple and secure
  • the method doesn’t rely on the Windows SDK, so you don’t have to bother with SDK path => much simplier :)
  • it’s a DLL so it’s very easy to integrate in your application

Additionally you’ll find two methods:

//Determines whether the specified certificate can sign code.
public static bool CanSignCode(X509Certificate2 certificate)

//Determines whether the specified file is signed using authenticode.
public static bool IsSigned(string filePath)

Happy authenticoding,

The R&D team

ASP.NET Identity Producer

CodeFluent Entities can generate out of the box Membership, Role & Profiles Providers. Recently Microsoft release a new Identity system: ASP.NET Identity. As it seems to be more and more use, we decided to write a new producer to support this new Identity system.

First of all, the source code of the producer is available on our GitHub repository.

The producer does two things:

  • It assists you in creating ASP.NET Identity entities (User, Role, Claim, Login)
  • It generates the UserStore and RoleStore and implements IUser and IRole

How to install

  • Download the code from GitHub and compile it. A compiled version is also available here
  • Copy the output “CodeFluent.Producers.AspNetIdentity.dll” to “C:\Program Files (x86)\SoftFluent\CodeFluent\Modeler”
  • (Optional) To integrate the producer to the graphical modeler copy or merge “custom.config” to “%APPDATA%\CodeFluent.Modeler.Design\custom.config”

How to use it

  1. Create a CodeFluent Entities project
  2. Add a Business Object Model (BOM) producer
  3. Add this new producer (Security -> Asp.Net Identity). Note: The target path has no effect. The target path will be “Target Path of the BOM Producer\Web\Security(User|Role)Store”
  4. Add New Producer

  5. Right click on the producer and click the “Create Identity Entities” menu item
  6. Create Identity Entities

  7. Select necessary entities (User, Role, Claim, Login) and the destination namespace
  8. ASP.NET Identity

  9. Customize entities. For example you can remove “Password” property if you don’t need it
  10. ASP.NET Identity Model

  11. Generate and use the code :)

Note: you must add the “Microsoft.AspNet.Identity.Core” Nuget package before compiling the generated code (but this is obvious).

CodeFluent Entities is very extensible. As we try to show in this article, one way of extending it is by using producers. Of course the main goal of producers is to generate code. But they can also interact with the model at design time thanks to the CodeFluent Entities API.

Please share your feedbacks about this producer and don’t hesitate to make some suggestion.

Happy coding!

The R&D Team.

Categories: Producers Tags: ,

CodeFluent Entities and Fetch Performance Benchmark

Two month ago, we heard about a benchmark that fetch performance of .NET Data Access Tools and ORMs. This benchmark has been introduced by Frans Bouma in this following blog post.

We started by creating a simple implementation with CodeFluent Entities and then analyze the result. Thanks to the flexibility of our product, it seems natural for us to provide an optimized but generic implementation. This means that the code is still generated.

CodeFluent Entities provides dynamics modeling features like “Aspects” to implement application-wide behaviors. This is what we call dynamic modeling. In a nutshell, in CodeFluent Entities, dynamic modeling is materialized as aspects and it allows developers to inject extra-behaviors in models.

That’s what gave us the idea of developing a new Aspect called “FasterReader” to reduce the number of data type conversion.
We explained our approach in a blog Post named “Fetch performance of CodeFluent Entities compared to others“.
This Aspect is generic (not “benchmark dedicated”) and can be used in any kind of model.

Once the article is published, we sent a Pull Request on the RawDataAccessBencher GitHub repository to submit the CodeFluent Entities implementation:


The initial commit is available here and includes the CodeFluent Entities Model with the SoftFluent.FasterReader.xml aspect.

We also modified the README.MD file with the following changes:

CodeFluent Entities is a Model-First code generator. CodeFluent Entities will access database using automatically generated stored procedures. For more information about CodeFluent Entities and this benchmark:

Of course, this readme includes a link to our blog post that explains the approach.

Then, Frans Bouma asked us to make some understandable changes before merging the code:

  • remove links to CodeFluent Entities website
  • remove a large file with all the procs
  • remove useless files in various folders regarding TFS, scc, resx, .user, etc.
  • remove the CodeFluent Entities Model

For your information about the last statement: we have chosen to add this project to let users generate again the code and to be completely transparent.

Of course, feedbacks has been considered a few days later:


At the end of April, the CodeFluent Entities implementation was finally merged:

But… the 5th of May, Frans Bouma removed our code:


With the following reason:

The CodeFluent code was removed as it kept the connection open during
individual fetches which therefore turned out to be faster than everyone
else. This was hard to find, and therefore a form of cheating.

By default, CodeFluent Entities opens one connection per thread but we attempted to explain that we can change this behavior. His reaction was the following:


You will find below the result with the custom configuration:

ADO.NET’s Connection Pooling keeps all connections open so that doesn’t change a lot of things so we don’t change this setting:


We understand the way out products connects to a database out-of-the-box is not ok for Mr Bouma, but we don’t really understand why he went so mad about this, treating us cheaters. Again, this is how it works out-the-box. Why should we investigate why our product – based on stored procedures – is faster than others? Mr Bouma could have discussed with us – like he did in the beginning of the whole process – and we could have changed this default behavior happily to comply with his rules. We were not trying to make a fool of him or to hide crucial information from him, just compete with other products. It’s a sad way of doing thing, and in the end, this behavior does not change anything to the numbers.

Moreover, if you want to check or test our implementation (the Model is included), please visit the following GitHub repository.

The R&D Team.

ASP.NET Identity v2 and CodeFluent Entities

April 30, 2014 Leave a comment

Update (2014/06/23) - please check out this related post :

A few weeks ago, we wrote about ASP.NET Identity v1 and CodeFluent Entities. The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems. It includes profile support, OAuth integration, works with OWIN and is included with the ASP.NET templates shipped with Visual Studio 2013.

ASP.NET Identity 2.0 was released last month so today we’ll see how to use it with CodeFluent Entities.

What’s new?

One of the drawbacks of the first release was that the primary key must be of type “string”. This new version allows to use any type as primary key. To do so, interfaces now have a second generic parameter, “TKey”, to specify the type of the primary key (int, Guid, etc.).
They also introduce new interfaces:

  • IUserLockoutStore<User, TKey>: allow to lock-out an account after a determined failed connection attempts
  • IUserEmailStore<User, TKey>: allow to store an email address and to confirm it (by sending an email for example)
  • IUserPhoneNumberStore<User, TKey>: allow to store a phone number and to confirm it (by sending a SMS for example)
  • IUserTwoFactorStore<User, TKey>: enable two-factor authentification (for example login/password and a token sent by email or SMS)

The implementation


Here’s the CodeFluent Entities Model to support those interfaces:


You’ll note that our model contains:

  • Implementation rules. We don’t even have to add partial class, everything is in the model
  • validation rules (EmailValidation) to ensure email address is valid
  • Unique contraints (UserName, Email, Role Name)

As for ASP.NET Identity v1, each method is only one or two lines of code:

public class UserStore :
    IUserStore<User, Guid>,
    IUserPasswordStore<User, Guid>,
    IUserSecurityStampStore<User, Guid>,
    IUserRoleStore<User, Guid>,
    IUserLoginStore<User, Guid>,
    IUserClaimStore<User, Guid>
    public Task<User> FindAsync(UserLoginInfo login)
        return Task.FromResult(User.LoadByProviderKey(login.ProviderKey));

    public Task ResetAccessFailedCountAsync(User user)
        user.AccessFailedCount = 0;
        return Task.FromResult(0);

    public Task<int> GetAccessFailedCountAsync(User user)
        return Task.FromResult(user.AccessFailedCount);

    // and so on

The full implementation is available on our GitHub repository.

The R&D team.

Views, Auto-Lightweight and the Modeler

April 22, 2014 Leave a comment

In a previous post we saw how to create views and lightweight entities by using XML. Nowadays most of you are using the graphical modeler, so let’s see how to create views.

First, let’s create a simple model:


We can create a view that contains the supplier name and the country name. Select the supplier entity and click the “Add view” button from the ribbon:

ribbon - add view

You should see the following window:

Add view 1

Enter a valid name and select properties to include in the view. Only properties from the selected entity are shown. So to add the country name, we have to click the “Add” button and enter the binding expression “Country.Name” (auto completion prevents mistakes).

Add view 2

The « Auto infer lightweight entity » checkbox allows to generate an entity that contains selected properties. As the name suggests it’s a light entity: it’s not persistent, it has no CRUD methods (e.g. load, save, delete) nor extra properties by default, and it does not implement any interfaces other than the ICodeFluentLightEntity by default.

Now we can create a method that will load data from this view:

load from view

The generated code contains the SQL view :

CREATE VIEW [dbo].[vSupplierSupplierLight]
SELECT [Supplier].[Supplier_Name], [Country].[Country_Name] AS 'CountryName'
FROM [Supplier]
INNER JOIN [Country]
ON ([Supplier].[Supplier_Country_Id] = [Country].[Country_Id])

And the inferred lightweight entity:



Happy View-ing!

The R&D team

Using LocalDB with CodeFluent Entities

April 8, 2014 Leave a comment

With Microsoft SQL Server 2012, Microsoft has introduced a feature called LocalDB which is a new edition of SQL Express. LocalDB is created specifically for developers and it is much easier to install (no service) and manage than standard editions. Developers initiate a connection by using a special connection string. It supports AttachDbFileName property, which allows you to specify a database file location.

When connecting, the server is automatically created and started, enabling the application to use the database without complex configuration tasks. This edition uses the same sqlservr.exe as the regular SQL Express and other editions of SQL Server.

The installation of Visual Studio 2012 and 2013 includes LocalDB 2012 and you can download the SQL Express 2014 LocalDb edition directly from the MSDN.

The SqlLocalDB Utility help you to manage your LocalDb instances. The following command will list you all LocalDB versions installed on your computer:


And the existing LocalDB instances owned by the current user and all shared LocalDB instances:


To check on the status and other details about an instance, you can run:


CodeFluent Entities Build 769 introduced the support of Microsoft SQL Server 2014 and gives you the opportunity to use SQL Server LocalDB (2012 and 2014) as your persistence server of your CodeFluent Entities application.

The SQL Server Producers allows you to generate your database layer on an SQL Server LocalDB instance:

SQL Server Producer LocalDb

Just build your model and connect to your LocalDb instance with SQL Server Management Studio or the Visual Studio Server Explorer. You can see that a new database has been created with the named you specified in the Connection String, and populated with the tables automatically inferred from your model as well as instances:

Server Explorer

Happy LocalDB-ing!

The R&D Team

What’s new with CodeFluent Entities 769?

April 7, 2014 Leave a comment

As with any previous release, CodeFluent Entities 769 includes numerous new features and bug fixes.

Keeping ahead with the latest technologies is our priority and we are extremely thrilled to announce that CodeFluent Entities now supports Microsoft SQL Server 2014.

Since the beginning of the year, CodeFluent Entities offers a new licensing model. You can try CodeFluent Entities by downloading the 30-day trial version which is unlimited in features and model size. The tool is also available in four registred editions: Personal (free for non-commercial use and limited to 50 entities), Professional, Enterprise and Ultimate.

But what else?


We made some greats improvements to the JsonUtilities:

Pretty-print Json

string json = @"{""name"": ""John Doe"",""age"": 35}";
var obj = JsonUtilities.Deserialize(json);
JsonUtilities.WriteFormatted(Console.Out, obj);

Will output:

  "name": "John Doe",
  "age": 35


JsonUtilities now supports XmlAttribute:

string json = @"{""name"": ""John Doe"",""age"": 35}";
var person = JsonUtilities.Deserialize<Person>(json, 

public class Person
    public string Name { get; set; }
    public int Age { get; set; }

We also added some automatic conversions between types. For example you can deserialize json to a Dictionary<string, decimal>. Values will be converted to decimal if possible. Internally this will use the ConvertUtilities class which I hope you are already using.

Relation UX improvements

We introduce a new ribbon item named Add relation. Of course the concept of relation already exists in the product, but we constantly strive to improve our product. Now there is an item in the ribbon to add a relation. The new form allows to select entities and properties and even create a new property if needed:

Add relations

When you don’t know which option to select (one-to-one, one-to-many, many-to-one or many-to-many) to define the type of relation, just read the description:

Relation Type

In this example, only the second sentence (one Customer has many Orders) is logical. If none of them seem valid, it may indicate that properties are badly named.

Microsoft SQL Server 2014 support

The SQL Server Producer now supports Microsoft SQL Server 2014. Christmas comes early for CodeFluent Entities users :).

SQL Server 2014

A new way to Activate

Last but not least, we provide a new screen to activate the product. With this new form, you can get your license key by connecting to your account directly in Microsoft Visual Studio:

Registered edition

If you are not a current customer, you can always download our free evaluation and see it in action.

Remember that you can follow the latest new features and bug fixes of CodeFluent Entities subscribing to this RSS Feed.

If you have any questions or comments, feel free to share them below.

Happy downloading!

The R&D Team

Fetch performance of CodeFluent Entities compared to others

March 27, 2014 Leave a comment

CodeFluent Entities has a great way to extend or modify generated code. This can be done through Custom Producers, Sub-Producers or Aspects. In fact, it can happen that you will meet very special requirements during your project, the kind of requirements that will involve some customizations to all of your code. Of course you don’t want to do this job manually by modifying each property or method in your project. Instead you can change the generated code to fit your expectations by using aspect. For a first introduction to aspect development in CodeFluent Entities please visit our blog.

In our situation, after reading Frans Bouma’s blog on benchmark of several ORMs of the .Net platform (Entity Framework, NHibernate, LLBLGen Pro, Linq To Sql and more), we wanted to integrate CodeFluent Entities to the benchmarks he made.

Integrating CodeFluent Entities to the benchmark project

First we downloaded the project from its GitHub repository.

After opening the RawBencher solution we created a CodeFluent Entities Model project:

CodeFluent Entities Project

Also we created a class library project to hold the code generated by CodeFluent Entities:

Class Library Project

Then we added one Business Object Model Producer and one SQL Server Producer to this project:

Solution Explorer

Here is the configuration for each producer:

Business Object Model

Business Object Model

Microsoft SQL Server

Microsoft SQL Server

Then we imported the AdventureWorks database to our CodeFluent Entities model:


Then select the Microsoft SQL Server importer:

SQL Server Importer

Finally, set the connection string as pictured below:

SQL Server importer configuration

Once the import from database was done we built the model project to generate C# code and database stored procedures. After this, for the final step we added a bencher class to call CodeFluent Entities generated code. We basically reproduced the same schema as the existing ones for other ORMs already set up in this benchmarking project.

We are now ready to start the benchmarking!

Running the benchmark and analyzing results

We ran the project in release mode and we got the following results:

Non-change tracking fetches, set fetches (10 runs), no caching:

  1. Handcoded materializer using DbDataReader: 214,63ms
  2. PetaPoco Fast v4.0.3: 285,50ms
  3. Dapper: 306,25ms
  4. Linq to SQL v4: 318,50ms
  5. PetaPoco v4.0.3: 355,00ms
  6. Entity Framework v6: 362,13ms
  7. CodeFluent Entities 551,00ms
  8. ServiceStack OrmList v4.0.9.0: 555,75ms
  9. LLBLGen Pro v4.1.0.0, typed view: 585,00ms
  10. Oak.DynamicDb using dynamic Dto class: 902,50ms

Non-change tracking individual fetches (100 elements, 10 runs), no caching:

  1. CodeFluent Entities: 0,18ms
  2. DataTable, using DbDataAdapter: 0,37ms
  3. Oak.DynamicDb using dynamic Dto class: 0,40ms
  4. LLBLGen Pro v4.1.0.0: 0,44ms
  5. Telerik DataAccess/OpenAccess Fluent v4.0.3: 0,50ms
  6. Telerik DataAccess/OpenAccess Domain v4.0.3: 0,50ms
  7. NHibernate v3.3.1.4000: 0,68ms
  8. Entity Framework v6: 1,85ms
  9. Linq to Sql v4: 2,89ms

We focused only on non-change Tracking mode because it is the one that matches CodeFluent Entities features.

We can see that CodeFluent Entities is ranked at the first place for single fetch operations. Also we can see that it is ranked 7th for the multiple fetch operations.

Of course each ORM offers different features and because of that some of them can have a more naïve approach than others which will check data type conversion for instance or check cache during the fetch. This will lead to a speed difference in execution time.

For example if you compare a SQL hand coded query against any ORM among the ones available in .NET, hand coded query will be for sure faster. In our case we can explain why CodeFluent Entities generated code is taking more time in the multiple set fetch operation. Basically the code generated is doing some additional operations that we can get rid of in this particular scenario:

For instance in this LoadAll method we do not need to check if an element is already contained in the inner list so we should remove the check:


Another example is the ReadReacord method, in this case we do not need to test if the reader is null or not, neither the options and since the type are secure and primitive types we do not need to use the CodeFluent Persistence GetReader methods a simple reader.GetIn32 or reader.GetDate can be used depending on the type:


After making these changes we can run the benchmark again to see what changed!

Running the benchmark with the adapted code

Here are the new result after code adaptation:

Non-change tracking fetches, set fetches (10 runs), no caching:

  1. Handcoded materializer using DbDataReader: 214,63ms
  2. CodeFluent Entities 273,25ms
  3. PetaPoco Fast v4.0.3: 285,50ms
  4. Dapper: 306,25ms
  5. Linq to SQL v4: 318,50ms
  6. PetaPoco v4.0.3: 355,00ms
  7. Entity Framework v6: 362,13ms
  8. ServiceStack OrmList v4.0.9.0: 555,75ms
  9. LLBLGen Pro v4.1.0.0, typed view: 585,00ms
  10. Oak.DynamicDb using dynamic Dto class: 902,50ms

After these changes CodeFluent Entities is now ranked at the 2nd place just after the hand coded query!

I will now show you how to make these custom changes more generic to apply them to the entire project for instance.

Understanding CodeFluent Entities Aspects

In CodeFluent Entities, the code generation process is model-first and continuous: from your declarative model, a meta-model will be inferred which code generators will then translate into code.

AspectAspects introduce a new notion allowing you to plug into this process. Using aspects you’ll be able to work on this in-memory representation of the model, before anything is produced and dynamically add/remove/modify elements in your model: this is what we call dynamic modeling. In a nutshell, in CodeFluent Entities, dynamic modeling is materialized as aspects and it allows developers to inject extra-behaviors in models.

You can easily see what the inferred model contains by selecting the option “View Inferred Model” on your project:

View Inferred Model

Then you can get details about any method or property of your code, for instance in our case the LoadAll method of the SalesOrderHeader entity:

Inferred Model

This inferred model will be used by the Business Object Model Producer we configured before to generate our code.

When you build your project, the enabled producers are instantiated to work on your model. With CodeFluent Entities you can interact at moment of the code production. For example you can change on the fly the behavior of your CodeDom producer (aka Business Object Model Producer) by accessing its instance:

CodeDomProducer codeDomProducer = Project.Producers.GetProducerInstance<CodeDomProducer>();

codeDomProducer.CodeDomProduction += (sender, e) =>
    //write your code here ...

And then you can manipulate this codeDomProducer object to change the body of your methods or do any other change to the generated code. In our case this will be very helpful to change the body of the LoadAll and ReadRecord methods.

Making code adaptation using aspects

In fact the changes we made can be reproduced automatically among the code by using a custom aspect that will interact with the Business Object Model Producer on the fly.

You can download the FastReader.xml file that contains the aspect we developed to make our customizations generic.

To remind you here is what the LoadAll method looked like before using the aspect:

LoadAll Before

Here is the new version of the same function:

LoadAll After

Another example is the ReadRecord method; here is what it was like before using the aspect:

Read Record Before

After enabling the aspect the method is replaced by a new one with the name FastReadRecord:

Read Record After

CodeFluent Entities offers many ways to customize the code generation and aspects is only one way among the others. In fact code customization can also be done by using sub-producers or patch-producers. Each technic has its pros and cons and in our case aspects was the best way to reach our goal. If you want to read more about sub-producers or patch producers please visit our blog here and here.

I hope this article helped you to figure out the flexibility of CodeFluent Entities.

Feel free to download and use the FastReader.xml aspect if you need.
Moreover, the full source code is available on our GitHub Profile.

Happy Adapting!

The R&D team.


Get every new post delivered to your Inbox.

Join 46 other followers