![]() ![]() In the next section of the tutorial, you'll add Azure Cache for Redis to optimize the data access and provide more features to the application.Ĭonfigure the app for Azure Cache for Redis Note the Create New, Edit, Details, and Delete actions that were automatically added to the application by the MVC 5 Controller with views, using Entity Framework scaffold. This version of the application reads the results directly from the database. Press Ctrl+F5 to build and run the application. Protected override void Seed(TeamContext context) Public class TeamInitializer : CreateDatabaseIfNotExists Simple random generation of statistics. Static public void PlayGames(IEnumerable teams) For more information on the code first approach to Entity Framework that's used in this tutorial, see Code first to a new database. This approach allows Entity Framework to create the database from your code. This tutorial is using the code first approach with Entity Framework. Replace the definition of the Team class with the following code snippet that contains an updated Team class definition and some other Entity Framework helper classes. Replace the using statements at the top of the Team.cs file with the following using statements: using System Right-click Models in Solution Explorer, and choose Add, Class.Įnter Team for the class name and select Add. ![]() Run the following command from the Package Manager Console window to install EntityFramework: Install-Package EntityFrameworkįor more information about this package, see the EntityFramework NuGet page. Select Tools > NuGet Package Manager > Package Manager Console. ![]() In Visual Studio, open the ContosoTeamStats Solution that you created in the ASP.NET quickstart for Azure Cache for Redis. In this section of the tutorial, you configure the ContosoTeamStats project with a leaderboard that reports the win, loss, and tie statistics for a list of fictional teams. NET desktop development with SQL Server Express LocalDB or SQL Server 2017 Express edition. Install Visual Studio 2019 with the following workloads:.If you haven't already, follow the quickstart first. This tutorial continues where you left off in ASP.NET quickstart for Azure Cache for Redis.To complete this tutorial, you must have the following prerequisites: If you don't have an Azure subscription, create an Azure free account before you begin. Publish the application to Azure using Visual Studio.Provision the Azure resources for the application using a Resource Manager template.Use a Redis sorted set to retrieve the top five teams.Improve data throughput and reduce database load by storing and retrieving data using Azure Cache for Redis. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |