当前位置: 首页>>代码示例>>C#>>正文


C# BasicRequest类代码示例

本文整理汇总了C#中BasicRequest的典型用法代码示例。如果您正苦于以下问题:C# BasicRequest类的具体用法?C# BasicRequest怎么用?C# BasicRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BasicRequest类属于命名空间,在下文中一共展示了BasicRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: With_TypedArguments

		public void With_TypedArguments()
		{
            serviceController.Register(typeof(BasicRequest), typeof(BasicService));
			var request = new BasicRequest();

			Console.WriteLine("With_TypedArguments(): {0}", Measure(() => serviceController.Execute(request), Times));
		}
开发者ID:Qasemt,项目名称:NServiceKit,代码行数:7,代码来源:PerfTests.cs

示例2: GetInfo

 private BasicResponse GetInfo(string typeCd)
 {
     var request = new BasicRequest();
     request.Add("TypeCd", typeCd);
     var logic = new GetOperateLogic();
     var response = PageCom.Invoke(logic, request);
     return response;
 }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:8,代码来源:booking-step-4.aspx.cs

示例3: With_ServiceStackFunq

        public void With_ServiceStackFunq()
        {
            var serviceController = new ServiceController();

            serviceController.Register(() => new BasicService());
            var request = new BasicRequest();

            Console.WriteLine("With_TypedArguments(): {0}", Measure(() => serviceController.Execute(request), Times));
        }
开发者ID:EvgeniyProtas,项目名称:servicestack,代码行数:9,代码来源:PerfTests.cs

示例4: With_Expressions

        public void With_Expressions()
        {
            var requestType = typeof(BasicRequest);

            serviceController.Register(requestType, typeof(BasicService));
            var request = new BasicRequest();

            Console.WriteLine("With_Expressions(): {0}", Measure(() => serviceController.Execute(request), Times));
        }
开发者ID:austinvernsonger,项目名称:ServiceStack,代码行数:9,代码来源:PerfTests.cs

示例5: With_Reflection

        public void With_Reflection()
        {
            var serviceController = new ServiceControllerReflection();

            serviceController.Register(() => new BasicService());
            var request = new BasicRequest();

            Console.WriteLine("With_Reflection(): {0}", Measure(() => serviceController.ExecuteReflection(request), Times));
        }
开发者ID:EvgeniyProtas,项目名称:servicestack,代码行数:9,代码来源:PerfTests.cs

示例6: With_CustomFunc

        public void With_CustomFunc()
        {
            var requestType = typeof(BasicRequest);
            var serviceController = new ServiceController();

            serviceController.Register(requestType, typeof(BasicService), type => new BasicService());

            var request = new BasicRequest();

            Console.WriteLine("With_CustomFunc(): {0}", Measure(() => serviceController.Execute(request), Times));
        }
开发者ID:EvgeniyProtas,项目名称:servicestack,代码行数:11,代码来源:PerfTests.cs

示例7: Save

 /// <summary>
 /// Xử lý filter
 /// </summary>
 private BasicResponse Save(HttpContext context, BasicRequest request)
 {
     // Khai báo biến cục bộ
     var logic = new SaveOperateLogic();
     var config = new BasicConfig();
     // Gán giá trị config
     config.RoleCd = W150901Logics.CD_ROLE_CD_ADM_MA_RMT_EN_UPDATE;
     // Tiến hành gọi logic
     var response = HandlerCom.Invoke(logic, request, config);
     // Kết quả xử lý
     return response;
 }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:15,代码来源:entry.ashx.cs

示例8: InitLayout

 /// <summary>
 /// Xử lý init
 /// </summary>
 private BasicResponse InitLayout(HttpContext context, BasicRequest request)
 {
     // Khai báo biến cục bộ
     var logic = new InitOperateLogic();
     var config = new BasicConfig();
     // Gán giá trị config
     config.RoleCd = W150901Logics.CD_ROLE_CD_ADM_MA_TOU_LI_VIEW;
     // Tiến hành gọi logic
     var response = HandlerCom.Invoke(logic, request, config);
     // Kết quả xử lý
     return response;
 }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:15,代码来源:list.ashx.cs

示例9: Filter

 /// <summary>
 /// Xử lý filter
 /// </summary>
 private BasicResponse Filter(HttpContext context, BasicRequest request)
 {
     // Khai báo biến cục bộ
     var logic = new FilterOperateLogic();
     var config = new BasicConfig();
     // Gán giá trị config
     config.RoleCd = W150901Logics.CD_ROLE_CD_ADM_SE_PAG_FILTER;
     // Tiến hành gọi logic
     var response = HandlerCom.Invoke(logic, request, config);
     // Kết quả xử lý
     return response;
 }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:15,代码来源:list.ashx.cs

示例10: By_default_assigned_roles_are_saved_in_UserAuth_table

        public void By_default_assigned_roles_are_saved_in_UserAuth_table()
        {
            using (var appHost = new BasicAppHost
            {
                ConfigureContainer = container =>
                {

                    container.Register<IDbConnectionFactory>(c =>
                        new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider));

                    container.Register<IAuthRepository>(c =>
                        new OrmLiteAuthRepository(c.Resolve<IDbConnectionFactory>()));

                    container.Resolve<IAuthRepository>().InitSchema();
                }
            }.Init())
            {
                using (var db = appHost.Container.Resolve<IDbConnectionFactory>().Open())
                {
                    var register = CreateNewUserRegistration();
                    var req = new BasicRequest(register);
                    req.QueryString["authSecret"] = appHost.Config.AdminAuthSecret = "allow";

                    var response = (RegisterResponse)appHost.ExecuteService(register, req);
                    var userAuth = db.SingleById<UserAuth>(response.UserId);

                    var assignResponse = (AssignRolesResponse)appHost.ExecuteService(new AssignRoles
                    {
                        UserName = userAuth.UserName,
                        Roles = { "TestRole" },
                        Permissions = { "TestPermission" },
                    }, req);
                    Assert.That(assignResponse.AllRoles[0], Is.EqualTo("TestRole"));
                    Assert.That(assignResponse.AllPermissions[0], Is.EqualTo("TestPermission"));

                    userAuth = db.SingleById<UserAuth>(response.UserId);
                    Assert.That(userAuth.Roles[0], Is.EqualTo("TestRole"));
                    Assert.That(userAuth.Permissions[0], Is.EqualTo("TestPermission"));

                    appHost.ExecuteService(new UnAssignRoles
                    {
                        UserName = userAuth.UserName,
                        Roles = { "TestRole" },
                        Permissions = { "TestPermission" },
                    }, req);

                    userAuth = db.SingleById<UserAuth>(response.UserId);
                    Assert.That(userAuth.Roles.Count, Is.EqualTo(0));
                    Assert.That(userAuth.Permissions.Count, Is.EqualTo(0));
                }
            }
        }
开发者ID:HarmenGrosseDeters,项目名称:ServiceStack,代码行数:52,代码来源:ManageRolesTests.cs

示例11: GenCd

 /// <summary>
 /// Xử lý gen mã
 /// </summary>
 public BasicResponse GenCd(HttpContext context, BasicRequest request)
 {
     // Khai báo biến cục bộ
     var response = new BasicResponse();
     // Trường hợp là đăng ký
     if (request.IsAdd) {
         Thread.Sleep(1000);
         response.Add("TypeCd", DataHelper.GetUniqueKey());
         response.Add(BasicResponse.PROP_RESULT_FLAG, true);
     }
     // Kết quả xử lý
     return response;
 }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:16,代码来源:entry.ashx.cs

示例12: CalcInfo

 private BasicResponse CalcInfo(BookingObject bookingObj)
 {
     var request = new BasicRequest();
     request.Add("TypeCd", bookingObj.TypeCd);
     request.Add("DateFrom", bookingObj.DateFrom);
     request.Add("DateTo", bookingObj.DateTo);
     request.Add("RoomQty", bookingObj.RoomQty);
     request.Add("HasPickUp", bookingObj.PickUp);
     request.Add("HasSeeOff", bookingObj.SeeOff);
     var logic = new CalcOperateLogic();
     var response = PageCom.Invoke(logic, request);
     return response;
 }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:13,代码来源:booking-step-3.aspx.cs

示例13: Invoke

 public BasicResponse Invoke(BasicRequest request)
 {
     // Khởi tạo biến cục bộ
     var logic = new FilterLogic();
     // Convert đối tượng request
     var inputObject = MapHelper.Convert<FilterDataModel>(request);
     // Thực thi xử lý logic
     var resultObject = logic.Execute(inputObject);
     // Convert đối tượng response
     var response = MapHelper.Convert<BasicResponse>(resultObject);
     // Kết quả trả về
     return response;
 }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:13,代码来源:FilterOperateLogic.cs

示例14: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            var request = new BasicRequest();
            request.Add("Slug", "destinations");
            var logic = new InitOperateLogic();
            var response = PageCom.Invoke(logic, request);

            var Pages = PageCom.GetValue<HashMap>(response, "Page");

            ltPageName.Text = PageCom.GetValue<string>(Pages, "PageName");
            ltPageContent.Text = PageCom.GetValue<string>(Pages, "Content");

            Page.Title = PageCom.GetValue<string>(response, "MetaTitle");
            Page.MetaKeywords = PageCom.GetValue<string>(response, "MetaKey");
            Page.MetaDescription = PageCom.GetValue<string>(response, "MetaDescription");
        }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:16,代码来源:destinations.aspx.cs

示例15: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            var request = new BasicRequest();
            request.Add("Slug", Request["name"]);
            var logic = new InitOperateLogic();
            var response = PageCom.Invoke(logic, request);

            var Tours = PageCom.GetValue<HashMap>(response, "Tour");

            ltTourTitle.Text = PageCom.GetValue<string>(Tours, "TourName");
            ltTourDes.Text = PageCom.GetValue<string>(Tours, "Notes");

            Page.Title = PageCom.GetValue<string>(response, "MetaTitle");
            Page.MetaKeywords = PageCom.GetValue<string>(response, "MetaKey");
            Page.MetaDescription = PageCom.GetValue<string>(response, "MetaDescription");
        }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:16,代码来源:tour-detail.aspx.cs


注:本文中的BasicRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。