Creating new instances while still using Dependency Injection
A quick description of the environment: I have a class that represents a chatroom and has a dependency on a logger. It's not the same as a system-wide logger with cross-cutting concerns, but a logger that's tied to that specific chatroom. It logs all activity in that chatroom to it's unique log file. When the chatroom is created I want to open the log file, and when it's destroyed I want to close the log file. The Problem Here's the relevant code I'm using. public interface IChatroomLogger { void Log(ServerPacket packet); void Open(); void Close(); } public class ChatroomLogger :