In this blog, I am going to explain how the Entity Framework Fluent API can be used for creating a platform application for .Net Developers which has to support ORM features as well. This platform application has to provide entity management privilege to the client application, which means that the client application can create & manage its entities in database via the platform application.
But! Before we start, we have to understand what the general expectations from the platform application are when it has to support development as well as entity management. Also have to understand how the Entity Framework Fluent API can be used in such an application.
Let's understand how Entity Framework Fluent API will support the desired behavior.
In our platform application we will follow the same approach as explained above to facilitate entity management.
Now the next question that comes to your mind is "how our client application is going to consume this platform for his/her entity creation".
One of the most important feature that we have to support while using Entity Framework Fluent API is DbMigration else our client application will through exception "The model backing the context has changed since the database was created".
So to implement DbMigration you have to create a sealed configuration class in the client application that inherits DbMigrationsConfiguration and set AutomaticMigrationsEnabled and AutomaticMigrationDataLossAllowed to true.
Now our platform application and its client application are ready to be consumed for any entity creation.