Example #1
0
        private static void Main(string[] args)
        {
            Console.WriteLine(@"Preparing the database...");
            SqlServerShared.RecreateDatabase();

            // Start self-hosted WCF server
            using (var host = new ServiceHost(
                       new InfoCarrierService(),
                       new Uri($"http://{WcfShared.BaseUrl}/{WcfShared.ServiceName}")))
            {
                host.AddDefaultEndpoints();
                foreach (var ep in host.Description.Endpoints)
                {
                    ep.Binding = new BasicHttpBinding {
                        MaxReceivedMessageSize = WcfShared.MaxReceivedMessageSize
                    };
                }

                host.Open();
                foreach (Uri addr in host.BaseAddresses)
                {
                    Console.WriteLine($@"The service is ready at {addr}");
                }

                Console.WriteLine(@"Press any key to stop.");
                Console.ReadKey();
                host.Close();
            }
        }
Example #2
0
        private static void Main(string[] args)
        {
            Console.WriteLine(@"Preparing the database...");
            SqlServerShared.RecreateDatabase();

            // Start self-hosted server
            using (var host = new AppHost().Init().Start(ServiceStackShared.BaseAddress))
            {
                Console.WriteLine(
                    "AppHost Created at {0}, listening on {1}",
                    DateTime.Now,
                    ((AppHost)host).WebHost.ServerFeatures.Get <IServerAddressesFeature>().Addresses.Single());

                Console.ReadKey();
            }
        }
Example #3
0
        public Startup(IConfiguration configuration)
        {
            this.Configuration = configuration;

            SqlServerShared.RecreateDatabase();
        }