In concluding this console application on the Mac, see how to create entities using the same code created earlier. Then, do the same for the Actor and Actor DbContext classes. Next, create core code in the program file. Finally, see how to build, add migrations, update the database, and run your application to demonstrate that it's truly cross-platform.
- [Instructor] Okay, we re ready to continue…building our application.…So, right now you see that…I have a prompt that says,…"Required asset to build."…If you get that prompt, it's okay to just click Yes.…And now we're ready to go ahead ad start with our steps.…The first of which we want to to do…is to go up to Macefconsoleapp…and right click and create an Entities folder.…So let's go ahead and hover over that.…You actually don't even need to right click,…just hovering will do,…and select New Folder,…and we'll type in Entities.…
And within entities, we're going to create our Actor class.…Now I can go ahead and right click, select New File,…type in Actor.cs.…And from here, I will just paste in…the content of our Actor class from before,…our previous project.…Let me go ahead to File.…
I have Auto Save checked, that's good.…Now I don't have to keep hitting Save every single time.…My next step now is to create an Actor DB context class.…So let's go ahead and do New File,…Actor,…ActorDBContext.cs.…
And likewise, I will paste in the content…
- Entity Framework (EF) overview
- Uses for EF
- Installing EF
- Creating entities
- Creating the DbContext
- Performing migrations
- Creating an MVC application
- Installing EF packages
- Reverse engineering the model
- Performing context and dependency injection
- Creating the controller and the view
- Using SqlServerTypeMapper
Skill Level Intermediate
Q: This course was updated on 06/23/2017. What changed?
A: The following topics were updated: using the exercise files; Mac install prerequisites; Entity Framework on Mac, part 1; and Entity Framework on Mac, part 2.