How to implement Entity Framework Core 3.1.2 with Firebird database using 'database first approach'

Viewed 2266

I am currently developing a .NET Core 3.1 Web API which should communicate with a Firebird database (storing/retrieving data). I would like to handle that communication using Microsoft.EntityFrameworkCore 3.1.2. Entity Framework is completely new for me so excuse me if this question is too simple. But I couldn't find the answer online.

Because the database is really big I want to automatically generate all my needed models using EF Core.

I tried using the Scaffold-DbContext command in the packet manager console:

Scaffold-DbContext "user id=USER;password=PASSWORD;database=DATABASE;data source=SOURCE;port number=PORT;character set=UNICODE_FSS;pooling=False;server type=Default" FirebirdSql.EntityFrameworkCore.Firebird -OutputDir Models 

Entity Framework Core is generating the Context.cs but not any models.

Do I have to specify the models I want to import? How do I do that?

2 Answers

To summarize the response to the question you posted on the firebird-net-provider group, support for scaffolding the model in EntityFrameworkCore is currently not available for Firebird. The improvement ticket for this is DNET-798.

You can also use that for MSSQL: Scaffold-DbContext "Server=ServerName;Database=DBName;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models.

For Firebird DB FirebirdSql.EntityFrameworkCore.Firebird doesn't support DbContext in version 7. You should use version 8 for Firebird.

Related