View component

    ASP.NET Core - 13. View Component

    ASP.NET Core - 13. View Component

    View Component는 Partial View를 지원하기 위한 action-style logic을 제공하는 class로서 View Component가 View에 내장될 복잡한 content를 제공하는 동시에 이를 지원하는 C# code를 쉽게 유지관리할 수 있도록 지원합니다. 1. Project 준비하기 이전에 사용하던 Project를 예제로 계속사용할 것입니다. 다만 Project의 Models folder에 city.cs라는 이름의 file을 아래 내용으로 추가하고 namespace MyWebApp.Models { public class City { public string? Name { get; set; } public string? Country { get; set; } public int?..