Introduction to Code First with IBM Data Server driver for EF 6
VishDev2018 50232PFTJ6 Visits (2276)
Entity Framework Code First support is introduced through IBM Data Server driver release v126.96.36.199. The NuGet package containing this support is available for download at NuGet. This blog provides details about using IBM Entity Framework for Code First, prerequisites and provides step by step details of some of the common application scenarios of Entity Framework Code First approach.
Through earlier versions of IBM Entity Framework it was possible to use only the existing database objects either into a EDM model(Database First) or code(Code from existing database objects). However, code first is also one of the popular workflows of Microsoft Entity Framework and support for the workflow is available in the latest release. Code First is the approach of creating domain classes first and then generating the database objects related to domain classes. Through IBM Entity Framework Code first support, users can create their domain classes first and then create database objects with IBM Data Server for LUW.
In this release the support is available for MS Entity Framework 6.1 and with .NET Framework version 4.7. Upcoming releases will have support for Code First with .NET Core also. Current support is for Db2 for LUW.
There are external blogs and MS documentation on how to use Code First workflow of Entity Framework. The additional blogs listed below refer to different application scenarios and important concepts of Code First approach with Db2 LUW database as a reference.
Note : Before starting with any application scenarios with IBM Entity Framework, please refer to the per-requisites mentioned here.
To get started on a MVC application using Entity Framework Code First, please refer MVC example.
To know more about Migration options, please refer here.
If you are looking for more information on Annotations and Fluent APIs, please refer the blog here.
For an example of using existing Database or specifying a new database, please refer the blog here.
If you are looking for a Stored Procedure example, please refer here.
For a specific example on how to use Code First with multiple inheritance, please refer the blog here.
To deploy a Code First Application on Microsoft Azure, please refer here.
To know more about Team Migrations, please refer here.
For a list of FAQs and limitations, please refer here.
For any further questions, please post a question in our discussion forum or contact IBM customer support.