Getting Started with Entity Framework Core [1 of 5]

Play Getting Started with Entity Framework Core [1 of 5]
Sign in to queue

Description

Entity Framework Core is an Object-Relational Mapper that simplifies working with relational databases using strongly-typed .NET objects. 

Watch the entire series here
Download Visual Studio 2019 here
Download .NET Core 3.0 here

Learn more about Entity Framework Core: 

Follow us: TwitterFacebookBlogsShows and Podcasts

Useful Links: .NETLearn .NET, .NET Community.NET Documentation

Embed

Download

The Discussion

  • User profile image
    Sunil Anthony

    Seems like EF Core 3.0 have a problem when doing a update-database. As you can see, it is missing the slash after the username.

    CREATE FILE encountered an operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Users\sunil.anthonyContosoPet.mdf

    Thank you,
    Sunil Anthony

  • User profile image
    Sunil Anthony

    Nevermind, I did some digging around and find out it was SQL 2017 MSSQL Local DB that had a bug and needed to be updated.

  • User profile image
    Jonathan Wood

    So, I see this was posted just last month. Yet, there are numerous changes between this video and the latest version of Visual Studio. For one thing, when I create a Razor Pages project, Entity Framework is already added to my project. (And NuGet has no Microsoft.EntityFrameworkCore.Design.) Also, when you created the data classes, it seemed like using statements for the data annotations namespaces were already added where I had to add them. There were a number of other differences too. And it would've been nice if you mentioned how to configure so that I can specify nullable strings and the like.

    .NET has been so fluid lately. Every time I come to build a new website, it seems like everything has changed again. So is anyone going to post a video like this for this month?

    Also, I started using computers around MS-DOS v1. There were no icons and commands had to be typed in. When Microsoft started adding the moniker "Visual" to everything it was to emphasize the point and click nature of those systems. So I find it interesting that progress now means I have to type commands into the console to build my database. I wonder if the current Visual Studio developers even know where the name Visual Studio moniker came from or what it meant.

  • User profile image
    JWood

    And BTW, my personal take is that the EDMX file was waaaaay easier than all the hoops that need to be jumped through when using the new and "improved" version of .NET and EF.

  • User profile image
    Eukaryote
    @Sunil Anthony:

    This is a well-known problem. They are not fixing it because the bug is in SQL Server 2017.

    I overcame it easily by first creating the database. Look for the connection string (appsettings.json) and the database server is something like (localdb)\MSSQLLOCALDB. Go to SSMS or Object Explorer and connect to this server. Then create a brand new database with the same name in the connection string. You can take the opportunity to reduce the length of the name from its cryptic guid version.

Add Your 2 Cents