강의

멘토링

커뮤니티

Inflearn Community Q&A

majaegeon's profile image
majaegeon

asked

[MMORPG Game Development Series with C# and Unity] Extra: ASP.NET Core Advanced

Dependency Injection

ConfigureServices 질문

Resolved

Written on

·

301

0

호스트가 서비스 컨테이너를 생성하고 ConfigureServices 메서드를 사용하여 서비스 컨테이너에 서비스를 등록한다고 알고있습니다. ( 틀릴 수도 있어요.)
강좌에서 ConfigureServices 메서드안에 생명주기가 있는 서비스를 넣는걸 보고 궁금해졌는데 Singleton 으로 만든 서비스는 앱 전체에서 하나만 생성되어 유일하게 사용되는것이고 나머지 Scoped 같은 것들은 HTTP 요청이 들어올 때 마다 
새로운 서비스가 생성되어 사용되는건가요?

MVCASP.NET-Core

Answer 1

1

Rookiss님의 프로필 이미지
Rookiss
Instructor

맞습니다.
Singleton = 유일
Scoped = 동일한 요청 내에서 유일
Transient = 매 번 새로
만드는 것이고 실제 각 서비스 생성자에 BreakPoint 걸어서 확인해보실 수 있습니다.

majaegeon's profile image
majaegeon

asked

Ask a question