{"id":20679,"date":"2023-11-17T18:30:00","date_gmt":"2023-11-17T09:30:00","guid":{"rendered":"https:\/\/itport.cloud\/?p=20679"},"modified":"2023-11-17T19:55:21","modified_gmt":"2023-11-17T10:55:21","slug":"post-20679","status":"publish","type":"post","link":"https:\/\/itport.cloud\/?p=20679","title":{"rendered":"ASP.NET Core MVC \u3067 \u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u2462"},"content":{"rendered":"\n\n\n<h2 class=\"wp-block-heading\" id=\"e79baee6aca1-1\">\u76ee\u6b21<\/h2>\n\n\n\n<p><a href=\"#1\" data-type=\"internal\" data-id=\"#1\">\u306f\u3058\u3081\u306b<\/a><br><a href=\"#2\" data-type=\"internal\" data-id=\"#2\">Model \u306e\u4f5c\u6210<\/a><br><a href=\"#3\" data-type=\"internal\" data-id=\"#3\">Controller \u306e\u5185\u5bb9\u3092\u8ffd\u52a0<\/a><br><a href=\"#4\" data-type=\"internal\" data-id=\"#4\">View \u306e\u5185\u5bb9\u3092\u5909\u66f4<\/a><br><a href=\"#5\" data-type=\"internal\" data-id=\"#5\">DB \u3068\u306e\u63a5\u7d9a<\/a><br><a href=\"#6\" data-type=\"internal\" data-id=\"#6\">\u6b21\u56de\u4e88\u544a<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>\u672c\u8a18\u4e8b\u306f\u3001ASP.NET Core MVC \u3092\u5229\u7528\u3057\u305fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u3064\u3044\u3066\u3001\u52c9\u5f37\u7528\u517c\u5099\u5fd8\u9332\u3068\u3057\u3066\u57f7\u7b46\u3057\u3066\u3044\u307e\u3059\u3002\u6700\u7d42\u7684\u306b\u3001\u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\uff08TODO\u30a2\u30d7\u30ea\uff09\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u76ee\u6a19\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u524d\u56de\u306f\u3001\u5b9f\u969b\u306b ASP.NET Core MVC \u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308a\u3001TODO\u30a2\u30d7\u30ea\u306e\u30e2\u30c3\u30af\u3092\u8868\u793a\u3055\u305b\u308b\u3068\u3053\u308d\u307e\u3067\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-it-port wp-block-embed-it-port\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"yp9M7wtxN6\"><a href=\"https:\/\/itport.cloud\/?p=20451\">ASP.NET Core MVC \u3067 \u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u2461<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;ASP.NET Core MVC \u3067 \u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u2461&#8221; &#8212; IT PORT\" src=\"https:\/\/itport.cloud\/?p=20451&#038;embed=true#?secret=yp9M7wtxN6\" data-secret=\"yp9M7wtxN6\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u4eca\u56de\u306f\u3001\u30e2\u30c3\u30af\u3067\u6c7a\u3081\u6253\u3061\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3057\u3066\u3044\u305f\u90e8\u5206\u3092\u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066\u753b\u9762\u4e0a\u306b\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u30e2\u30c7\u30eb\u306e\u8ffd\u52a0\u30fb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u5909\u66f4\u30fb\u30d3\u30e5\u30fc\u306e\u5909\u66f4\u3092\u884c\u3044\u3001DB\u4e0a\u306b\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u3059\u308b\u307e\u3067\u3092\u884c\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2\">Model \u306e\u4f5c\u6210<\/h2>\n\n\n\n<p>\u3067\u306f\u3001\u65e9\u901f\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br>\u300cModels\u300d\u30d5\u30a9\u30eb\u30c0\u2015\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3001\u300c\u8ffd\u52a0&nbsp;&gt;&nbsp;\u30af\u30e9\u30b9\u300d\u306e\u9806\u306b\u9078\u629e\u3057\u3066\u3001\u300cToDoTask.cs\u300d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"491\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-173154-1024x491.jpg\" alt=\"\" class=\"wp-image-20697\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-173154-1024x491.jpg 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-173154-300x144.jpg 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-173154-768x368.jpg 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-173154-1536x736.jpg 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-173154-450x216.jpg 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-173154-900x431.jpg 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-173154.jpg 1912w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u300cModels\/ToDotask.cs\u300d\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<br>\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u3001\u30e2\u30c3\u30af\u3067\u4f5c\u6210\u3057\u3066\u3044\u305f\u9805\u76ee\u306e\u5185\u5bb9\u3068\u540c\u4e00\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nusing Microsoft.AspNetCore.Identity;\nusing Microsoft.EntityFrameworkCore.Metadata.Internal;\nusing System.ComponentModel;\nusing System.ComponentModel.DataAnnotations;\nusing System.ComponentModel.DataAnnotations.Schema;\n\nnamespace MvcApplication1.Models\n{\n    public class ToDoTask\n    {\n        \/\/ ID\n        public int Id { get; set; }\n\n        \/\/ \u5b8c\u4e86\u30d5\u30e9\u30b0\n        public bool isDone { get; set; }\n\n        \/\/ \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\n        &#x5B;Display(Name = \"\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\")]\n        &#x5B;Required(ErrorMessage = \"{0}\u306f\u5fc5\u9808\u3067\u3059\")]\n        &#x5B;MaxLength(50, ErrorMessage = \"{0}\u306f{1}\u6587\u5b57\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\")]\n        public string ProjectName { get; set; } = string.Empty;\n\n        \/\/ \u5185\u5bb9\n        &#x5B;Display(Name = \"\u5185\u5bb9\")]\n        &#x5B;Required(ErrorMessage = \"{0}\u306f\u5fc5\u9808\u3067\u3059\")]\n        &#x5B;MaxLength(50, ErrorMessage = \"{0}\u306f{1}\u6587\u5b57\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\")]\n        public string TaskName { get; set; } = string.Empty;\n\n        \/\/ \u671f\u9650\u65e5\n        &#x5B;Display(Name = \"\u671f\u9650\u65e5\")]\n        &#x5B;DisplayFormat(DataFormatString = \"{0:yyyy\/MM\/dd}\")]\n        public string? DeadLine { get; set; } = string.Empty;\n\n        \/\/ \u767b\u9332\u65e5\n        &#x5B;Display(Name = \"\u767b\u9332\u65e5\")]\n        &#x5B;DisplayFormat(DataFormatString = \"{0:yyyy\/MM\/dd}\")]\n        public string? CreateDateTime { get; set; } = string.Empty;\n\n        \/\/ \u66f4\u65b0\u65e5\n        &#x5B;Display(Name=\"\u66f4\u65b0\u65e5\")]\n        &#x5B;DisplayFormat(DataFormatString = \"{0:yyyy\/MM\/dd}\")]\n        public string? UpdateDateTime { get; set; } = string.Empty;\n    }\n}\n<\/pre><\/div>\n\n\n<p>\u3053\u3053\u3067\u30dd\u30a4\u30f3\u30c8\u3068\u306a\u308b\u306e\u304c\u3001&nbsp;<code>Id<\/code>&nbsp;\u3068\u3044\u3046\u540d\u524d\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u3002<br>\u5f8c\u307b\u3069\u767b\u5834\u3057\u3066\u304f\u308b\u300c EntityFrameworkCore \u300d\u306b\u3088\u3063\u3066\u3001<code>Id<\/code>&nbsp;\u307e\u305f\u306f&nbsp;<code>&lt;type name&gt;Id<\/code>&nbsp;\u3068\u3044\u3046\u540d\u524d\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u81ea\u52d5\u7684\u306b\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u306e\u4e3b\u30ad\u30fc\u3068\u3057\u3066\u5224\u65ad\u3055\u308c\u3001\u6570\u5024\u578b\u306e\u5834\u5408\u306f\u81ea\u52d5\u63a1\u756a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u5fc5\u305a\u8a2d\u5b9a\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3\">Controller \u306e\u5185\u5bb9\u3092\u8ffd\u52a0<\/h2>\n\n\n\n<p>\u3067\u306f\u3001\u753b\u9762\u5074\u3067\u5148\u307b\u3069\u306e\u30e2\u30c7\u30eb\u304c\u4f7f\u7528\u3055\u308c\u308b\u3088\u3046\u306b\u3001\u300cController\/HomeController.cs\u300d\u306e\u5185\u5bb9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nusing Microsoft.AspNetCore.Mvc;\nusing MvcApplication1.Models;\nusing System;\nusing System.Diagnostics;\n\nnamespace MvcApplication1.Controllers\n{\n    public class HomeController : Controller\n    {\n        private readonly ILogger&lt;HomeController> _logger;\n        private static List&lt;ToDoTask> _toDoTask = new List&lt;ToDoTask>()\n        {\n            new ToDoTask{ Id=1, isDone=true, ProjectName=\"\u25a0\u25b2\u25cf\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\", TaskName=\"\u3007\u3007\u30b7\u30b9\u30c6\u30e0\u306e\u63d0\u6848\u66f8\u4f5c\u6210\", DeadLine=\"2023\/10\/31\", CreateDateTime=DateTime.Now.ToString(\"yyyy\/MM\/dd\") ,UpdateDateTime=DateTime.Now.ToString(\"yyyy\/MM\/dd\")},\n            new ToDoTask{ Id=2, isDone=false, ProjectName=\"ABC\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\", TaskName=\"\u3007\u3007\u306e\u898b\u7a4d\u4f5c\u6210\", DeadLine=\"2023\/11\/10\", CreateDateTime=DateTime.Now.ToString(\"yyyy\/MM\/dd\") ,UpdateDateTime= DateTime.Now.ToString(\"yyyy\/MM\/dd\")},\n            new ToDoTask{ Id=3, isDone=false, ProjectName=\"\u3007\u25b3\u25a1\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\", TaskName=\"\u3007\u3007\u30b7\u30b9\u30c6\u30e0\u306e\u6539\u4fee\", DeadLine=\"2023\/11\/30\", CreateDateTime=DateTime.Now.ToString(\"yyyy\/MM\/dd\") ,UpdateDateTime= DateTime.Now.ToString(\"yyyy\/MM\/dd\")},\n        };\n\n        public IActionResult Index()\n        {\n            return View(_toDoTask);\n        }\n\n        public HomeController(ILogger&lt;HomeController> logger)\n        {\n            _logger = logger;\n        }\n        public IActionResult Privacy()\n        {\n            return View();\n        }\n\n        &#x5B;ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]\n        public IActionResult Error()\n        {\n            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });\n        }\n    }\n}\n<\/pre><\/div>\n\n\n<p>\u3053\u306e<code>_toDoTask<\/code> \u30ea\u30b9\u30c8\u306f\u3001ToDo\u30bf\u30b9\u30af\u306e\u30c7\u30fc\u30bf\u3092\u4e00\u6642\u7684\u306b\u683c\u7d0d\u3057\u3001 \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u3067 ToDo\u30bf\u30b9\u30af\u60c5\u5831\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002 <br>\u4eca\u56de\u306f\u3001\u753b\u9762\u8868\u793a\u6642\u306b\u5206\u304b\u308a\u3084\u3059\u3044\u3088\u3046\u306b\u3001\u30e2\u30c3\u30af\u3067\u8868\u793a\u3057\u3066\u3044\u305f\u3082\u306e\u3068\u540c\u3058\u5185\u5bb9\u306e\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u3092\uff13\u3064\u542b\u3081\u307e\u3057\u305f\u3002<br>\u305d\u3057\u3066\u3001\u753b\u9762\u8868\u793a\u6642\u306b\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\uff13\u3064\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u3001<code>Index()<\/code>\u30e1\u30be\u30c3\u30c8\u3067\u4f5c\u6210\u3057\u305f <code>_toDoTask<\/code> \u30ea\u30b9\u30c8\u3092\u30d3\u30e5\u30fc\u5074\u306b\u6e21\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4\">View \u306e\u5185\u5bb9\u3092\u5909\u66f4<\/h2>\n\n\n\n<p>\u3067\u306f\u3001\u30d3\u30e5\u30fc\u5074\u3067\u3001\u30e2\u30c7\u30eb\u306e\u5024\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u300cViews\\Home\\Index.cshtml\u300d\u306e\u5185\u5bb9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n@model IEnumerable&lt;MvcApplication1.Models.ToDoTask>\n\n@{\n    ViewData&#x5B;\"Title\"] = \"Home Page\";\n}\n\n&lt;div>\n    &lt;div class=\"text-center my-sm-5\">\n        &lt;h1>TODO \u30ea\u30b9\u30c8&lt;\/h1>\n    &lt;\/div>\n    &lt;div style=\"margin-bottom:20px;\">\n        &lt;div>\n            &lt;button type=\"button\" class=\"btn btn-outline-primary\">\u30bf\u30b9\u30af\u8ffd\u52a0&lt;\/button>\n        &lt;\/div>\n    &lt;\/div>\n&lt;\/div>\n&lt;table class=\"table\">\n    &lt;thead>\n        &lt;tr>\n            &lt;th>\n            &lt;\/th>\n            &lt;th>\n                @Html.DisplayNameFor(model => model.ProjectName)\n            &lt;\/th>\n            &lt;th>\n                @Html.DisplayNameFor(model => model.TaskName)\n            &lt;\/th>\n            &lt;th>\n                @Html.DisplayNameFor(model => model.DeadLine)\n            &lt;\/th>\n            &lt;th>\n                @Html.DisplayNameFor(model => model.CreateDateTime)\n            &lt;\/th>\n            &lt;th>\n                @Html.DisplayNameFor(model => model.UpdateDateTime)\n            &lt;\/th>\n            &lt;th>\n                \u7de8\u96c6\u30fb\u524a\u9664\n            &lt;\/th>\n        &lt;\/tr>\n    &lt;\/thead>\n    &lt;tbody>\n        @foreach (var item in Model)\n        {\n            &lt;tr>\n                &lt;td>\n                    &lt;input type=\"checkbox\" class=\"form-check-input\" @(item.isDone ? \"checked\" : \"\")>\n                &lt;\/td>\n                &lt;td>\n                    @Html.DisplayFor(modelItem => item.ProjectName)\n                &lt;\/td>\n                &lt;td>\n                    @Html.DisplayFor(modelItem => item.TaskName)\n                &lt;\/td>\n                &lt;td>\n                    @Html.DisplayFor(modelItem => item.DeadLine)\n                &lt;\/td>\n                &lt;td>\n                    @Html.DisplayFor(modelItem => item.CreateDateTime)\n                &lt;\/td>\n                &lt;td>\n                    @Html.DisplayFor(modelItem => item.UpdateDateTime)\n                &lt;\/td>\n                &lt;td>\n                    &lt;button type=\"button\" class=\"btn-primary\">\u7de8\u96c6&lt;\/button>\n                    &lt;button type=\"button\" class=\"btn-secondary\">\u524a\u9664&lt;\/button>\n                &lt;\/td>\n            &lt;\/tr>\n        }\n    &lt;\/tbody>\n&lt;\/table>\n&lt;div>\n    &lt;nav>\n        &lt;ul class=\"pagination justify-content-center\">\n            &lt;li class=\"page-item\">\n                &lt;a class=\"page-link\" href=\"#\">\uff1c&lt;\/a>\n            &lt;\/li>\n            &lt;li class=\"page-item\">&lt;a class=\"page-link\" href=\"#\">1&lt;\/a>&lt;\/li>\n            &lt;li class=\"page-item\">&lt;a class=\"page-link\" href=\"#\">2&lt;\/a>&lt;\/li>\n            &lt;li class=\"page-item\">&lt;a class=\"page-link\" href=\"#\">3&lt;\/a>&lt;\/li>\n            &lt;li class=\"page-item\">\n                &lt;a class=\"page-link\" href=\"#\">\uff1e&lt;\/a>\n            &lt;\/li>\n        &lt;\/ul>\n    &lt;\/nav>\n&lt;\/div>\n<\/pre><\/div>\n\n\n<p>\u4e00\u756a\u4e0a\u306e<code>@model IEnumerable&lt;MvcApplication1.Models.ToDoTask&gt;<\/code>\u3067\u306f\u3001\u30d3\u30e5\u30fc\u30da\u30fc\u30b8\u306b\u5bfe\u3059\u308b\u30e2\u30c7\u30eb\u306e\u578b\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br><code>@foreach (var item in Model) { ... }<\/code>\u3067\u3001ToDoTask \u306e\u30ea\u30b9\u30c8\u3092\u30eb\u30fc\u30d7\u51e6\u7406\u3057\u307e\u3059\u3002<code>Model<\/code>\u306f\u30d3\u30e5\u30fc\u306b\u6e21\u3055\u308c\u305f\u30e2\u30c7\u30eb\u30c7\u30fc\u30bf\u3067\u3001<code>item<\/code>\u306f\u5404ToDo\u30bf\u30b9\u30af\u3092\u8868\u3057\u307e\u3059\u3002<br><br>\u3067\u306f\u3001\u4e00\u5ea6\u753b\u9762\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"346\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-195255-1024x346.jpg\" alt=\"\" class=\"wp-image-20705\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-195255-1024x346.jpg 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-195255-300x101.jpg 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-195255-768x259.jpg 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-195255-1536x519.jpg 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-195255-450x152.jpg 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-195255-900x304.jpg 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-195255.jpg 1915w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> <code>_toDoTask<\/code> \u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30e2\u30c7\u30eb\uff13\u3064\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002\u30e2\u30c7\u30eb\u3092\u4f7f\u3063\u3066\u753b\u9762\u5074\u306b\u8868\u793a\u3067\u304d\u307e\u3057\u305f\uff01<br>\u3067\u306f\u6b21\u306b\u3001DB\u3068\u306e\u63a5\u7d9a\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5\">DB\u3068\u306e\u63a5\u7d9a<\/h2>\n\n\n\n<p>DB\u3092\u4f5c\u6210\u3057\u3001\u30a2\u30d7\u30ea\u3068\u9023\u643a\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u3001\u4e0b\u8a18\u306e\u624b\u9806\u3092\u8e0f\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Nuget \u30d1\u30c3\u30b1\u30fc\u30b8\u304b\u3089 Entity Framework Core \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/li><li>\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b<\/li><li>\u4f9d\u5b58\u6027\u6ce8\u5165\uff08Dependency Injection\uff09<\/li><li>\u30a2\u30d7\u30ea\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u63a5\u7d9a\u6587\u5b57\u5217\u3092\u8ffd\u52a0<\/li><li>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210\u30fb\u9069\u7528<\/li><li>DB \u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"nuget-e38391e38383e382b1e383bce382b8e3818be38289-entity-framework-core-e38292e382a4e383b3e382b9e38388e383bce383abe38199e3828b-2\">Nuget \u30d1\u30c3\u30b1\u30fc\u30b8\u304b\u3089 Entity Framework Core \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h4>\n\n\n\n<p>\u4eca\u56de\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b PostgreSQL \u3092\u4f7f\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br>Nuget \u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u306e\u7ba1\u7406\u753b\u9762\u304b\u3089\u3001\u300cnpgsql\u300d\u3067\u691c\u7d22\u5f8c\u3001<strong>\u300cNpgsql.EntityFrameworkCore.PostgresSQL<\/strong>\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"623\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-143450-1024x623.jpg\" alt=\"\" class=\"wp-image-20681\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-143450-1024x623.jpg 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-143450-300x183.jpg 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-143450-768x467.jpg 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-143450-450x274.jpg 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-143450-900x548.jpg 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-143450.jpg 1093w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u300c\u6b63\u5e38\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3057\u305f\u300d<\/strong>\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u308c\u3070\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"e382b3e383b3e38386e382ade382b9e38388e382afe383a9e382b9e38292e5ae9ae7bea9e38199e3828b-3\">\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b<\/h4>\n\n\n\n<p>\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\u306e\u304c\u3001\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30af\u30e9\u30b9\u3067\u3059\u3002<br>\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u3001&nbsp;\u300cModels\u300d\u30d5\u30a9\u30eb\u30c0\u30fc\u914d\u4e0b\u306b&nbsp;\u300cToDoTaskContext.cs<strong>\u300d<\/strong>&nbsp;\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"534\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-151026-1024x534.jpg\" alt=\"\" class=\"wp-image-20683\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-151026-1024x534.jpg 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-151026-300x156.jpg 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-151026-768x400.jpg 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-151026-450x234.jpg 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-151026-900x469.jpg 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-151026.jpg 1282w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> \u300cToDoTaskContext.cs<strong>\u300d<\/strong>\u306e\u30b3\u30fc\u30c9\u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nusing Microsoft.EntityFrameworkCore;\n\nnamespace MvcApplication1.Models\n{\n    public class TodoTaskContext :DbContext\n    {\n        public TodoTaskContext(DbContextOptions&lt;TodoTaskContext> options) : base(options)\n        {\n        }\n        public DbSet&lt;ToDoTask> ToDoTask { get; set; }\n    }\n}\n<\/pre><\/div>\n\n\n<p><code>TodoTaskContext<\/code>&nbsp;\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30fc\u306f\u3001 ASP.NET Core\u306e\u4f9d\u5b58\u6027\u6ce8\u5165\uff08Dependency Injection\uff09\u3092\u4ecb\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u60c5\u5831\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002 <br><code>TodoTaskContext<\/code>&nbsp;\u30af\u30e9\u30b9\u3067\u306f\u3001DB\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30e2\u30c7\u30eb\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3001 Entity Framework Core \u3092\u4f7f\u7528\u3057\u3066 DB \u306b\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3001\u66f4\u65b0\u3001\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"e4be9de5ad98e680a7e6b3a8e585a5-efbc88dependency-injectionefbc89-4\"> \u4f9d\u5b58\u6027\u6ce8\u5165 \uff08Dependency Injection\uff09 <\/h4>\n\n\n\n<p>\u5148\u7a0b\u8a71\u304c\u51fa\u307e\u3057\u305f\u304c\u3001ASP.NET Core\u306b\u306f\u3001&nbsp;<strong>Dependency Injection(DI)<\/strong> \u304c\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u307e\u3059\u3002DI \u306f\u3001\u4f9d\u5b58\u95a2\u4fc2\u306e\u7ba1\u7406\u306b\u5f79\u7acb\u3064\u4e00\u822c\u7684\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002<br>\u300cProgram.cs\u300d\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092 DI \u306b\u767b\u9332\u3059\u308b\u3088\u3046\u306b\u3001\u4e0b\u8a18\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvar connectionString = builder.Configuration.GetConnectionString(\"DefaultConnection\");\nbuilder.Services.AddDbContext&lt;TodoTaskContext>(options => options.UseNpgsql(connectionString));\n<\/pre><\/div>\n\n\n<p>\uff11\u884c\u76ee\u306e<code>connectionString<\/code>\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3057\u305f\u3082\u306e\u3067\u3059\u3002&#8221;DefaultConnection&#8221; \u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\uff08appsettings.json\u306a\u3069\uff09\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u63a5\u7d9a\u6587\u5b57\u5217\u306e\u540d\u524d\u3067\u3059\u3002<br>\u3053\u306e\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u6587\u5b57\u5217\u3092\u7528\u3044\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3084\u308a\u53d6\u308a\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\uff12\u884c\u76ee\u3067\u884c\u3063\u3066\u3044\u307e\u3059\u3002<br><br>\u203b \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u6587\u5b57\u5217 \u30fb\u30fb\u30fb \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u542b\u3093\u3067 \u3044\u308b\u3082\u306e<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"e382a2e38397e383aae8a8ade5ae9ae38395e382a1e382a4e383abe381abe68ea5e7b69ae69687e5ad97e58897e38292e8bfbde58aa0-5\">\u30a2\u30d7\u30ea\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u63a5\u7d9a\u6587\u5b57\u5217\u3092\u8ffd\u52a0<\/h4>\n\n\n\n<p>\u3067\u306f\u3001\u5148\u7a0b\u8a71\u304c\u3042\u304c\u3063\u305f\u300c\u63a5\u7d9a\u6587\u5b57\u5217\u300d\u3092\u300cappsettings.json\u300d\u30d5\u30a1\u30a4\u30eb\u3078\u8ffd\u52a0\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u60c5\u5831\u306f\u3001\u81ea\u5206\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"User Id=postgres;Password=password;Server=localhost;Database=MvcApplication1;Port=5432;Pooling=true;\"\n  },\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"e3839ee382a4e382b0e383ace383bce382b7e383a7e383b3e381aee4bd9ce68890e383bbe981a9e794a8-6\">\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210\u30fb\u9069\u7528<\/h4>\n\n\n\n<p>\u6700\u5f8c\u306b\u3001Entity Framework Core \u306e<strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u6a5f\u80fd\u306b\u3088\u3063\u3066\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u5b9a\u7fa9\u3092\u3001DB\u306b\u79fb\u884c\u3055\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<br><br>\u307e\u305a\u3001\u30b3\u30de\u30f3\u30c9\u304c\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u300cMicrosoft.EntityFrameworkCore.Tools\u300d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30d1\u30c3\u30b1\u30fc\u30b8\u30de\u30cd\u30fc\u30b8\u30e3\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u5f8c\u3001&nbsp;\u30d1\u30c3\u30b1\u30fc\u30b8 \u30de\u30cd\u30fc\u30b8\u30e3\u30fc \u30b3\u30f3\u30bd\u30fc\u30eb \u4e0a\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nPM> Add-Migration InitialModels\n<\/pre><\/div>\n\n\n<p>\u300cBuild succeeded.\u300d\u304c\u8868\u793a\u3055\u308c\u308c\u3070 OK \u3067\u3059\u3002\u3053\u308c\u306f\u3001&#8221;InitialModels&#8221;\u3068\u3044\u3046\u540d\u524d\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br>\u7d9a\u3044\u3066\u3001Entity Framework Core \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u9069\u7528\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nPM> Update-Database\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"db-e38292e7a2bae8aa8de38197e381a6e381bfe3828b-7\">DB \u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b<\/h4>\n\n\n\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b DB \u304c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u306e\u30e2\u30c7\u30eb\u3068\u540c\u3058\u5185\u5bb9\u3067\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"408\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-203827-1024x408.jpg\" alt=\"\" class=\"wp-image-20710\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-203827-1024x408.jpg 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-203827-300x119.jpg 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-203827-768x306.jpg 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-203827-1536x612.jpg 1536w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-203827-450x179.jpg 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-203827-900x358.jpg 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2023\/10\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-10-08-203827.jpg 1703w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>PgAdmin \u3067\u78ba\u8a8d\u3059\u308b\u3068\u3001\u78ba\u304b\u306b\u300cMvcApplication1\u300d\u3068\u3044\u3046DB\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\uff01<br>\u300cToDoTask\u300d\u30c6\u30fc\u30d6\u30eb\u306e\u4e2d\u8eab\u3092\u898b\u3066\u307f\u308b\u3068\u3001Model \u3067\u8a2d\u5b9a\u3057\u305f\u901a\u308a\u306b\u30c6\u30fc\u30d6\u30eb\u9805\u76ee\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6\"> \u6b21\u56de\u4e88\u544a<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f \u3001 \u30e2\u30c3\u30af\u3067\u6c7a\u3081\u6253\u3061\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3057\u3066\u3044\u305f\u90e8\u5206\u3092\u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066\u753b\u9762\u4e0a\u306b\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u30e2\u30c7\u30eb\u306e\u8ffd\u52a0\u30fb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u5909\u66f4\u30fb\u30d3\u30e5\u30fc\u306e\u5909\u66f4\u3092\u884c\u3044\u3001DB\u4e0a\u306b\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u3059\u308b\u307e\u3067\u3092\u884c\u3044\u307e\u3057\u305f\u3002 <br>\u6b21\u56de\u306f\u3001 \u30c6\u30fc\u30d6\u30eb\u3068\u306e\u95a2\u9023\u4ed8\u3051\u3068 ToDo \u30bf\u30b9\u30af\u306e\u300c\u8ffd\u52a0\u300d\u300c\u7de8\u96c6\u300d\u300c\u524a\u9664\u300d\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/itport.cloud\/?p=20013\" data-type=\"URL\" data-id=\"https:\/\/itport.cloud\/?p=20013\"><a href=\"https:\/\/itport.cloud\/?p=20013\" data-type=\"URL\" data-id=\"https:\/\/itport.cloud\/?p=20013\">ASP.NET Core MVC \u3067 \u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u2460\u3000\uff5e ASP.NET Core MVC \u306e\u6982\u8981 \uff5e<\/a><\/a><\/li><li><a href=\"https:\/\/itport.cloud\/?p=20451\" data-type=\"URL\" data-id=\"https:\/\/itport.cloud\/?p=20451\">ASP.NET Core MVC \u3067 \u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u2461\u3000\uff5e Web\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u3066\u307f\u308b \uff5e<\/a><\/li><li>ASP.NET Core MVC \u3067 \u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u2462\u3000\uff5e \u30e2\u30c7\u30eb\u3092\u4f7f\u3063\u3066\u8868\u793a\u3057\u3066\u307f\u308b \uff5e<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"\u76ee\u6b21 \u306f\u3058\u3081\u306bModel \u306e\u4f5c\u6210Controller \u306e\u5185\u5bb9\u3092\u8ffd\u52a0View \u306e\u5185\u5bb9\u3092\u5909\u66f4DB \u3068\u306e\u63a5\u7d9a\u6b21\u56de\u4e88\u544a \u306f\u3058\u3081\u306b \u672c\u8a18\u4e8b\u306f\u3001ASP.NET Core MVC \u3092\u5229\u7528\u3057\u305fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306b\u3064\u3044\u3066\u3001\u52c9\u5f37\u7528\u517c\u5099\u5fd8\u9332\u3068\u3057\u3066\u57f7\u7b46\u3057\u3066\u3044\u307e\u3059\u3002\u6700\u7d42\u7684\u306b\u3001\u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\uff08TODO\u30a2\u30d7\u30ea\uff09\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u76ee\u6a19\u306b\u306a\u308a\u307e\u3059\u3002 \u524d\u56de\u306f\u3001\u5b9f\u969b\u306b ASP.NET Core MVC \u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308a\u3001TODO\u30a2\u30d7\u30ea\u306e\u30e2\u30c3\u30af\u3092\u8868\u793a\u3055\u305b\u308b\u3068\u3053\u308d\u307e\u3067\u884c\u3044\u307e\u3057\u305f\u3002 https:\/\/itport.cloud\/?p=20451 \u4eca\u56de\u306f\u3001\u30e2\u30c3\u30af\u3067\u6c7a\u3081\u6253\u3061\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3057\u3066\u3044\u305f\u90e8\u5206\u3092\u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066\u753b\u9762\u4e0a\u306b\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u30e2\u30c7\u30eb\u306e\u8ffd\u52a0\u30fb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u5909&hellip;","protected":false},"author":30,"featured_media":20701,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[152],"tags":[153],"class_list":{"0":"post-20679","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-asp-net-core-mvc","8":"tag-season52"},"_links":{"self":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/20679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20679"}],"version-history":[{"count":44,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/20679\/revisions"}],"predecessor-version":[{"id":20867,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/20679\/revisions\/20867"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/media\/20701"}],"wp:attachment":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}