harxのブログ

プログラミングとかDTMとか写真とか

2022-01-01から1年間の記事一覧

ASP.NET Core Webアプリのポート変更

変更方法 program.cs内で宣言されてるappのUrlsプロパティのAddメソッドを使用することで変更できる。 var app = builder.Build(); // 5024番ポートに変更 app.Urls.Add("http://192.168.1.27:5024"); app.Urls.Add("http://localhost:5024");

ASP.NET Entity Framework - モデル作成

モデルとなるクラスの作成 using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; namespace API.Models.Users { [Index(nameof(Email), IsUnique = true)] public class User { [Key] public Guid Guid { get; set; } public…

ASP.NET Entity Frameworkでよく使うコマンド

# モデルからテーブルを作る場合 add-migration AddedCodeFirstTable # マイグレーションをDBに反映させるコマンド Remove-Migration