I have been using F# for some time, and really liking it.
I want to use type providers for data access, but would love to have entity framework migrations.
Can I use EF migrations without entity framework? I am fine with writing migration code by hand, hopefully in F#.
This sound is usually considered to be an allophone of /h/, which is pronounced in different ways depending upon its context; Japanese /h/ is pronounced as [ɸ] before /u/. In Welsh orthography, ⟨f⟩ represents /v/ while ⟨ff⟩ represents /f/. In Slavic languages, ⟨f⟩ is used primarily in words of foreign (Greek, Latin, or Germanic) origin.
In countries such as the United States, the letter "F" is defined as a failure in terms of academic evaluation. Other countries that use this system include Saudi Arabia, Venezuela, and the Netherlands. In the hexadecimal number system, the letter "F" or "f" is used to represent the hexadecimal digit fifteen (equivalent to 15 10 ).
In the Etruscan alphabet, 'F' probably represented /w/, as in Greek, and the Etruscans formed the digraph 'FH' to represent /f/.
It is often doubled at the end of words. Exceptionally, it represents the voiced labiodental fricative / v / in the common word "of". F is the twelfth least frequently used letter in the English language (after C, G, Y, P, B, V, K, J, X, Q, and Z ), with a frequency of about 2.23% in words.
In the case where you want to use EFCore, it's possible to isolate only the migrations in a C# project with MigrationsAssembly.
For example in a DbContext
module:
let setupOptions (optionsBuilder: DbContextOptionsBuilder) =
optionsBuilder.UseNpgsql(
"Host=localhost;Database=mydb;Username=postgres;Password=postgres",
fun opt -> opt.MigrationsAssembly "MyProject.Data.Migrations" |> ignore)
|> ignore
Services configuration:
services.AddDbContext<DbContext.MyDbName>(DbContext.setupOptions)
CLI:
dotnet ef migrations add CreateFoo -p ./MyProject.Data.Migrations -s ./MyProject.Api -v
dotnet ef database update -p ./MyProject.Data.Migrations -s ./MyProject.Api -v
There is also a work in progress project to support F# design-time: https://github.com/bricelam/EFCore.FSharp
F# type providers imply that there is already external data source i.e. they are inherently "Db First". Using EF Code First only to automatically generate migrations is not the best idea, I recommend plain SQL and some tools to keep track of migrations such as dbup. I answered it in details in similar but bigger question.
You can certainly use EF migrations without using EF in your app. Create a separate project and use Code First migrations.
I'm not aware that the migrations scaffolding feature supports F#. Either suffer with C# for migrations or translate the code yourself?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With