using System.Collections.Generic; namespace Model { public class ActorProxyComponent: Component { private readonly Dictionary dictionary = new Dictionary(); public ActorProxy Get(long id) { if (this.dictionary.TryGetValue(id, out ActorProxy actorProxy)) { return actorProxy; } actorProxy = EntityFactory.CreateWithId(id); this.dictionary[id] = actorProxy; return actorProxy; } } }