Question: C# using visual studio Create a console app that uses an EF data model to access the Players table in the database provided. 1 .

C# using visual studio
Create a console app that uses an EF data model to access the Players table in the database provided.
1. Create a console app named BaseballApp.
2. Use the NuGet package manager to install the following packages: o Microsoft.EntityFrameworkCore
o Microsoft.EntityFrameworkCore.Tools
o Microsoft.EntityFrameworkCore.SqlServer
o Microsoft.EntityFrameworkCore.Design
3. Using the Package Manager console, enter the following Scaffold-DbContext command to construct a data model with a DbContext class named BaseballContext for the Baseball.mdf file provided. (More details on this command may be found here)
Scaffold-DbContext connStr Microsoft.EntityFrameworkCore.SqlServer -Context name
where connStr is a connection string and name is the name for the DbContext class
4. Instantiate the BaseballContext class in the console app.
5. Use the OrderBy method to display the names and batting averages of all players in the Players table in ascending order by the players batting average.
6. Use the Where method to display the name and averages of only the players whose first names begin with J.
7. Display all players again after adding yourself to the player table with an average of 0.34.
8. Change your average to 0.379.
9. After this change, display only players with averages over 0.35.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!