Book Image

ASP.NET Core Essentials

By : Shahed Chowdhuri
Book Image

ASP.NET Core Essentials

By: Shahed Chowdhuri

Overview of this book

<p>ASP.NET Core is the latest collection of Microsoft’s web application development technologies. When you’re trying to reach a broad spectrum of users with a robust web application, ASP.NET Core is there to help you build that application. With the ability to cater to users on desktop, tablet, or smartphone platforms, you can put together a solution that works well anywhere.</p> <p>This book is what you need to get started developing ASP.NET Core applications was quickly as possible; starting by introducing the software and how it can be used in today’s modern world of web applications and smartphone apps. Walking you through the benefits of a Web API to support both applications and mobile apps to give you a solid understanding of the tech to build upon as you see what ASP.NET Core can do for you.</p> <p>The book wraps up with practical guidelines for the use of database technologies, unit tests, security best practices, and cloud deployments for the real world.</p>
Table of Contents (15 chapters)
ASP.NET Core Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

EF Code First migrations for database versioning and maintenance


In EF, you can use migrations to facilitate the creation, upgrade, and downgrade of your database. You can also use the automatically generated version history to keep track of changes and stay in sync with the rest of your development team.

We have previously set up migrations in our sample project to get the ball rolling. In this section, we will add a new migration to reflect the changes we made in this chapter.

Setting up migrations

The following is a recap of how we previously set up our migrations for EF. Once again, keep in mind that your DNX version may vary:

  1. Open a command prompt to your project folder's location.

  2. Run the following commands:

>dotnet restore
>dotnet build
>dotnet ef migrations add Initial
>dotnet ef database update

The preceding commands do not need to be run again, as your initial migration has already been created back in Chapter 3 , Understanding MVC. Instead, we will run additional commands...