public MicroResolverContainer()
        {
            ContainerProvider <TState> .BeginCreation(this);

            Register <ContainerProvider <TState> >();
            EntityManager = new EntityManager(ResolveStorage);
        }
 public void Dispose()
 {
     if (!_alreadyBuilt)
     {
         ContainerProvider <TState> .EndCreation();
     }
     foreach (var systemType in _registeredSystems)
     {
         GetSystem(systemType).Dispose();
     }
 }
        public IContainer <TState> Build()
        {
            if (_alreadyBuilt)
            {
                throw new InvalidOperationException("Container is already built");
            }
            _resolver.Compile();
            foreach (var type in _registeredTypes)
            {
                _resolver.Resolve(type);
            }
            BuildExecutionOrder();
            _alreadyBuilt = true;
            ContainerProvider <TState> .EndCreation();

            return(this);
        }