Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learning Angular for .NET Developers

You're reading from   Learning Angular for .NET Developers Develop dynamic .NET web applications powered by Angular 4

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781785884283
Length 248 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Rajesh Gunasundaram Rajesh Gunasundaram
Author Profile Icon Rajesh Gunasundaram
Rajesh Gunasundaram
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
1. Getting Started with Angular 2. Angular Building Blocks - Part 1 FREE CHAPTER 3. Angular Building Blocks - Part 2 4. Using TypeScript with Angular 5. Creating an Angular Single-Page Application in Visual Studio 6. Creating ASP.NET Core Web API Services for Angular 7. Creating an Application Using Angular, ASP.NET MVC, and Web API in Visual Studio 8. Testing Angular Applications 9. What s New in Angular and ASP.NET Core

Using DB Migration


DB migration in Entity Framework helps you create a database or update a database schema during the application's development phase. We now have the required model and database context in place. We need to create the database now. Let's create the database in SQL Server Compact using the feature called database migration in Entity Framework. Follow these steps to do so:

  1. First, add the following XML tags to the csproj file by editing it:
  <ItemGroup>   
    <DotNetCliToolReference    
    Include="Microsoft.EntityFrameworkCore.Tools.DotNet"  
    Version="1.0.0" />   
  </ItemGroup>   
  1. Open Command Prompt and navigate to the project folder.

  1. Execute the following command to initialize the database for migration:

Execute the command to add migration

This command creates the Migration folder under the MyTodo project and adds two classes to create tables and update the schema.

Files related to database migration

  1. Execute the following command to update the database...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Banner background image