-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: any practical differences between 2 types of declarations in DbContext? #73
Comments
Doesn't seem to make a difference but a plain member val is definitely more succinct |
When I take this approach, the entity members of type MyDataContext() =
inherit DbContext()
member val MyExampleTable: DbSet<MyTableType> = null with get,set
[<DefaultValue>]
val mutable private myExampleTable2: DbSet<MyTableType2>
member __.MyExampleTable2
with get () = __.myExampleTable2
and set v = __.myExampleTable2 <- v
use db = new MyDataContext()
db.MyExampleTable2.First() |> ignore // works
db.MyExampleTable.First() |> ignore // null exception |
No, it does seem that this approach does result in the members remaining |
Looks like this has been raised in the past: fsharp/fslang-suggestions#103 |
Adding new types to DbContext, your intro suggests this type of syntax
Wouldn't it be the same to use this syntax from practical point of view?
As far as migrations generation, both seem to work fine...
The text was updated successfully, but these errors were encountered: