public ServerSettings Get(QueryServerSettings request)
        {
            ServerSettings config;

            using (var session = DocumentStore.OpenSession())
            {
                config = session.Load <ServerSettings>("ServerSettings/1");

                if (config == null)
                {
                    // provide some default values and store them
                    config = new ServerSettings()
                    {
                        Id                   = 1,
                        GitExecutable        = @"c:\Program Files (x86)\git\bin\git.exe",
                        NuGetServerUri       = new Uri("http://localhost/nuggy/nuget"),
                        VersionControlSystem = VersionControlSystem.Git,
                        WorkDir              = @"c:\powerdeploy\work",
                    };

                    session.Store(config);
                    session.SaveChanges();
                }
            }

            return(config);
        }
        public ServerSettings Get(QueryServerSettings request)
        {
            ServerSettings config;

            using (var session = DocumentStore.OpenSession())
            {
                config = session.Load<ServerSettings>("ServerSettings/1");

                if (config == null)
                {
                    // provide some default values and store them
                    config = new ServerSettings()
                    {
                        Id = 1,
                        GitExecutable = @"c:\Program Files (x86)\git\bin\git.exe",
                        NuGetServerUri = new Uri("http://localhost/nuggy/nuget"),
                        VersionControlSystem = VersionControlSystem.Git,
                        WorkDir = @"c:\powerdeploy\work",
                    };

                    session.Store(config);
                    session.SaveChanges();
                }
            }

            return config;
        }