Entity Framework Code First Fluent API – Can I create a fluent rules engine.

I am currently working through a lot of training courses (due to my employer being in special administration).

I have started on the Entity Framework Code First modules.
EF Code first seems to provide a declarative way of having a set of business entities that do not know about the database be persisted and loaded.

I am not interested in the annotation api since that is tying the business entities to the database.
[Rule #1 The model should not know about the view or the database.]

However the fluent api looks very interesting in that it can be used as an ORM (albeit a very simple one).
This means that a model could have two databases that it maps to (say old system and new system, or production and archive) that have distinct schema’s.

What would be interesting would be to see if this fluent api could not also be used as a validating rules engine. A given object can have different validation rules depending upon context.

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 )

Connecting to %s