According to official Microsoft documentation, if we execute the Nuget restore command inside a project, it tries to install all the package dependencies according to the references in your project file(.csproj) or your packages.config file. First, it installs the direct dependencies then installs the dependencies of those packages throughout the entire dependency graph.