0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ASP.NETcoreでMySQLを使えるようにするまでに行ったこと

Last updated at Posted at 2018-03-11

前提条件

  • 開発はWindows上で行う
  • 実行環境はLinuxサーバーを用いる

プロジェクトを作成する

この辺りのサイトを参考にプロジェクトを作成する

Databaseを作成するためのモデルを定義する

IDesignTimeDbContextFactoryを実装
DbContextを実装
Table定義を行う

各コマンド実行

PowerShellを起動

  • 表示→その他のウィンドウ→パッケージマネージャコンソール

Migration用のコードを現在のモデルから自動生成

  • Add-Migrations

データベースに構成を反映

  • Update-Database

確認

  • MySQL WorkBenchなどからスキーマを確認する

作業を行う上で参考にしたサイト

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?