ASP.NET MVC 5 - 폴더 구조

ASP.NET MVC 5 - 폴더 구조

ASP.NET MVC 5 폴더 구조

이번 강의에서, 당신은:

1. ASP.NET MVC 폴더 구조

Before, deep diving into ASP.NET MVC 5, there are certain guidelines that you must follow in order to write MVC code properly and structured. MVC Folder Structure guides you to choose a suitable folder to store different types of files.

ASP.NET MVC5를 본격적으로 시작하기 전에, MVC를 적절하고 구조적으로 코딩하기 위해 따라야 하는 가이드라인이 있습니다. MVC 폴더 구조는 다른 종류의 파일을 적합한 폴더에 넣도록 도와줍니다.

Solution Explorer

솔루션 탐색기

MVC 폴더 구조

App_Data – LocalDB, .mdf files, xml files 등등의 파일을 포함합니다.

App_Start – It contains class files which gets executed when application starts. Normally it is config files like BundleConfig.cs, AuthConfig.cs, FilterConfig.cs etc.

어플리케이션이 시작되었을때 실행되는 클래스 파일을 포함합니다. 보통like BundleConfig.cs, AuthConfig.cs, FilterConfig.cs 등등의 configs 파일입니다.

Content – css files, images and icon files 등의 정적인 파일을 포함합니다.

Controllers – It contains class files which handle user's request and response. All the controller file name ends with Controller word like HomeController, LoginController, ProfileController etc.

사용자의 요청과 응답을 다루는 클래스 파일을 포함합니다. HomeController, LoginController, ProfileController와 같이 -Controller로 끝나는 파일명을 가집니다.

Models – 데이터베이스를 다루는 모델 클래스 파일을 가집니다.

Scripts – JavaScript, VBScript, JQuery등의 스크립트를 가집니다.

Views – HTML을 포함합니다. 컨트롤러별로 각각의 폴더가 존재합니다. 예를들어 HomeController.cs에 대응하는 Home폴더가 View 폴더안에 있습니다.

Shared - 뷰 폴더 하위에 있으며, 마스터 페이지 layout 등의 파일을 포함합니다. Shared folder의 구성요소는 어느 컨트롤러에서나 접근 가능합니다.

SOME IMPORTANT FILES | 몇몇 중요한 파일들

Global.json – 이 파일은 의존성을 추가하거나 현재 프로젝트에 외부 프로젝트 참조를 추가할 때 사용됩니다. 이 파일은 시스템이 의존성 폴더를 찾도록 경로를 지정합니다. This file is used for add dependencies or add external projects reference into your current project. It specifies the path where system should search for dependency folder.

Project.json – asp.net core의 Project.json은 프로젝트의 메타 데이터, 편집 정보와 의존성을 선언하는데에 사용됩니다.

Global.asax – Application_BeginRequest, application_start, application_error, sesson_start, sesson_end등의 어플리케이션 레벨 이벤트에서 코드를 작성하도록 해줍니다.

Package.config – 이것은 NuGet 에 의해 관리되며, 어떤 패키지와 버전을 어플리케이션에 설치했는지를 기록합니다.

Web.config – 어플리케이션 레벨 구성을 포함합니다.

SUMMARY | 요약

이 강의는 ASP.NET MVC5의 폴더 구조만을 소개합니다. 폴더의 특성과 속성을 알게 되면, 프로젝트에 관련된 파일을 찾고 저장하고 구성하는게 쉬워집니다. 다음 강의에서, 당신은 MVC5의 컨트롤러에 대해 배우게 됩니다.

from http://ghchoi0427.tistory.com/37 by ccl(A) rewrite - 2020-03-16 23:54:33

댓글

이 블로그의 인기 게시물

HTML 13단계 - 폼(Form) 1탄

[C#]Log4Net 사용법

임시 인터넷 파일캐싱을 위한 방지 html,css,javascript