This is the old way of working with the Entity Framework. The most current way uses only project file settings web.config
and Nuget packages.
The ADO.NET provider to Firebird and its respective Entity Framework support can be easily installed using the following commands in the Package Manager Console (View > Other Windows > Package Manager Console):
PM> Install-Package FirebirdSql.Data.FirebirdClient
PM> Install-Package EntityFramework.Firebird
The setting in the web.config
is done as follows:
<configuration>
...
<entityFramework>
<defaultConnectionFactory type="FirebirdSql.Data.EntityFramework6.FbConnectionFactory, EntityFramework.Firebird" />
<providers>
<provider invariantName="FirebirdSql.Data.FirebirdClient" type="FirebirdSql.Data.EntityFramework6.FbProviderServices, EntityFramework.Firebird" />
</providers>
</entityFramework>
...
</configuration>
In addition, it is necessary to inform a Connection string in the same file:
<configuration>
...
<connectionStrings>
<add name="DefaultConnection" connectionString="User=usuario;Password=senha;Database=C:/caminho/do/arquivo.fdb;DataSource=localhost;Port=3050;Dialect=3;Charset=NONE;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet size=8192;ServerType=0;" providerName="FirebirdSql.Data.FirebirdClient" />
</connectionStrings>
...
</configuration>
EDIT
For reverse engineering, install the DDEX software in your Visual Studio. You can download it here.
I installed the packages already but intended to use a library class for the model. How do this configuration in the library class ?
– Victor Glauber
Ask another question, please. It’s gonna be kind of out of context for me to put it all here.
– Leonel Sanches da Silva
Do I use App.config? I would like to do the other way to generate domain classes through DB using reverse engineering in the Entity Framework. Is it possible to do that ? Thank you.
– Victor Glauber
@Victorglauber I updated the answer.
– Leonel Sanches da Silva
@Ciganomorrisonmendes I already have DDEX installed, VS recognizes the Firebird Data Source (.NET Framework Data Provider for Firebird) as possibility to add a new connection VS - DB but the VS or cancels the operation of add conection and back on the home screen or hangs and reboots. Is there any other way to reverse engineer this case? Thank you
– Victor Glauber
I’m installing the providers here to reproduce the problem. Apparently it’s something in your configuration.
– Leonel Sanches da Silva
Let’s go continue this discussion in chat.
– Victor Glauber