Closed zelenij closed 3 years ago
Hi @zelenij This should be resolved now by https://www.nuget.org/packages/EntityFrameworkCore.FSharp/5.0.3-alpha8
Thanks, will give it a go a bit later! :)
Hi,
I'm using 5.0.3-alpha9. There seems to a little mistake at the end of each record.
Code generated:
values = array2D [ [ Guid("cd735892-e9a7-4b36-b910-03e97a95b421") :> obj; "user1" ] :> obj; [ Guid("ff7b5153-2218-45bc-9838-892b99f97b59") :> obj; "user2" ] ]
Should be:
values = array2D [ [ Guid("cd735892-e9a7-4b36-b910-03e97a95b421") :> obj; "user1" :> obj ]; [ Guid("ff7b5153-2218-45bc-9838-892b99f97b59") :> obj; "user2" :> obj ] ]
The :> obj
cast is not inside the bracket. And it's missing at the last record.
Thank you!
And there is an error FS0039 in BuildTargetModel
, in my case the Id
property can't be resolved (I only have the german error message).
Maybe it should be an anonymous record at that place (that's what gets suggested as a fix)?
Sorry, I'm new to F#... :)
Generated:
b.HasData([|
{ Id = Guid("cd735892-e9a7-4b36-b910-03e97a95b421"); Username = "user1"; }
{ Id = Guid("ff7b5153-2218-45bc-9838-892b99f97b59"); Username = "user2"; }
|]) |> ignore
Should be?
b.HasData([|
{| Id = Guid("cd735892-e9a7-4b36-b910-03e97a95b421"); Username = "user1"; |}
{| Id = Guid("ff7b5153-2218-45bc-9838-892b99f97b59"); Username = "user2"; |}
|]) |> ignore
Hi @flensrocker
You're absolutely right, that should be an anonymous record type in the HasData
method
I've just released https://www.nuget.org/packages/EntityFrameworkCore.FSharp/5.0.3-alpha10 if you can take a look, should address both issues
I will take a look later this evening or tomorrow. Thank you!
Can't wait... :)
It works in my case!
A simple type:
Given a list of values, I add them in DbContext:
The generated migrations code looks invalid: