Page 1 of 1

Using dotConnect with F#

Posted: Fri 18 Oct 2013 17:04
by siklosg
I'm pretty new to .Net and F# but have been using PostgreSQL for a long time.

Can I connect to a PostgreSQL DB from F# using the EF provided by dotConnect? How would I need to configure the type provider for such a connection?

Thanks in advance!

Re: Using dotConnect with F#

Posted: Mon 21 Oct 2013 14:06
by Shalex
You can employ a plain ADO.NET using dotConnect for PostgreSQL with F#:

Code: Select all

open Devart.Data.PostgreSql
let conn = new PgSqlConnection("server=db;port=5441;uid=postgres;pwd=postgres;database=postgres;")
conn.Open()
Currently Entity Developer is designed to generate only C# and VB code for Entity Framework models.

As a workaround, create a model and generate the C#/VB code in a separate C#/VB project. Then add a reference to the compiled C#/VB assembly in your F# project and use its types.