コード例 #1
0
        /// <summary>
        /// Uses the TabConfiguration to determine what to show
        /// Loads the uCommerce version and the SchemaVersion.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            uCommerceVersionHeader.Visible = _configuration.ShowUCommerceVersion;
            SchemaVersionHeader.Visible    = _configuration.ShowShemaVersion;

            uCommerceVersion.Text = SampleApi.uCommerceVersion();

            SchemaVersion.Text = SampleApi.SchemaVersion();
        }
コード例 #2
0
 public static Server CreateLocalServer(MockMethodHandler methodHandler)
 {
     var server = new Server()
     {
         Services = { SampleApi.BindService(new SampleApiMock(methodHandler)) },
         Ports = { new ServerPort("localhost", 0, ServerCredentials.Insecure) }
     };
     return server;
 }
        public async Task <IActionResult> RunApi(string name)
        {
            // If the user is not signed in, redirect him to home
            if (!AuthContext.IsSignedIn(HttpContext))
            {
                Redirect(ControllerRoutes.HomePage);
            }

            SampleApi sampleApi = SampleApiList.GetSampleApiByName(name);

            SampleApiResult result = await SampleApiRunner.ExecuteApiCall(HttpContext, sampleApi);

            return(View(result));
        }
コード例 #4
0
        /// <summary>
        /// Loads uCommerce version and the database schema version.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            uCommerceVersion.Text = SampleApi.uCommerceVersion();

            SchemaVersion.Text = SampleApi.SchemaVersion();
        }