using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Repo.Data; using Repo.DAL; var builder = WebApplication.CreateBuilder(args); builder.Services.AddDbContext(options => options.UseSqlServer(builder.Configuration.GetConnectionString("RepoContext") ?? throw new InvalidOperationException("Connection string 'RepoContext' not found."))); builder.Services.AddScoped(); //★IPespoインターフェースにMoivieRepoを挿入! // Add services to the container. builder.Services.AddControllersWithViews(); // ★Buildの前にサービスを登録する var app = builder.Build(); ・・・