EntityFramework.Docs icon indicating copy to clipboard operation
EntityFramework.Docs copied to clipboard

welcome example is not working

Open MarcTolkmitt opened this issue 1 year ago • 4 comments

Type of issue

Code doesn't work

Description

Well, finally i found the newest documentation ( version 8 ) and it is still not working from the start:
in the function 'OnConfiguring' you use the 'optionsBuilder**.UseSqlServer**( ...' . -> There is no '.UseSqlServer' to be found.

And there is the questions why do you use properties?

Page URL

https://learn.microsoft.com/de-de/ef/core/

Content source URL

https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/index.md

Document Version Independent Id

f4681bc6-57be-6e69-cad9-776ce64d93bd

Article author

@ajcvickers

MarcTolkmitt avatar Feb 10 '24 09:02 MarcTolkmitt

Have you tried Getting Started with EF Core?

ajcvickers avatar Feb 12 '24 09:02 ajcvickers

Well, sure i am still learning it. And that means i am now with 'Creating a model -> keys'. But my intitial request is about what you read first at the top. I can explain that it is very frustrating to find working examples. If you search for it EF 6 has the most weight in the search engines and you happen to be catched in a loop with Visual Studio claiming that data sources are not supported. You click the link and find a tutorial starting the same not working ways again. Thats why i was happy to find this documention finally via the link from the NuGet package. But the documentation is not correct and seems to be done in very fast ways just to push it into the newest shape without testing. It's always only a litte bit that's missing, like first example a few lines about the to be installed NuGet packages ( '.UseSQLServer' ). That carries on to ... example: tutorial with WPF, where the screenshots are from 2019 and it is about EF 8. While it seems to work, the program is not taking numbers/producing them for the second list ( products -> ProductID ). You should be the one being better in knowing why not - i could guess its about foreign keys are made read-only in the tables?

Lastly i really wonder about the use of properties - for me you only need them if you leave C# for example if you use XAML. But where do you leave C# here? Is it the parsing into SQL from EF? I read that you watch out for properties in the data classes to migrate them into the tables automaticly - but this is the doing of EF and why have i to use properties?

i hope you don't feel offended - this wasn't my wish

MarcTolkmitt avatar Feb 12 '24 14:02 MarcTolkmitt

@MarcTolkmitt The doc page you are commenting on is supposed to tell you what EF Core is not how to use it. The page that tells you what packages to install, etc. is the "Getting Started" page.

ajcvickers avatar Feb 12 '24 14:02 ajcvickers

Yes, i think it is a documentation issue. The documentation is part of 'https://learn.microsoft.com/' and then there is a special frame to the pages...

MarcTolkmitt avatar Feb 12 '24 14:02 MarcTolkmitt