• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# BasicRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            var request = new BasicRequest();
            request.Add("Slug", "contact-us");
            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");
            getInfoCompany();
            btnSubmit.Text = Strings.CLN_CONTACT_US_SEND;
        }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:18,代码来源:contact-us.aspx.cs


示例17: btnSubmit_Command

 protected void btnSubmit_Command(object sender, CommandEventArgs e)
 {
     var request = new BasicRequest();
     request.Add("Name", txtName.Text);
     request.Add("Phone", txtPhone.Text);
     request.Add("Email", txtEmail.Text);
     request.Add("Description", txtDescription.Text);
     var logic = new SendMailOperateLogic();
     var response = PageCom.Invoke(logic, request);
     if (response.ResultFlag)
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "clientscript", "<script> alert('" + Strings.CLN_ALERT_SUCCESS + "'); </script>");
         clearControls();
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "clientscript", "<script> alert('" + Strings.CLN_ALERT_ERROR + "'); </script>");
     }
 }
开发者ID:ctsoftvn,项目名称:cts-w-1509-01,代码行数:19,代码来源:contact-us.aspx.cs


示例18: GetRegistrationService

        public static UserRegistrationService GetRegistrationService(
            AbstractValidator<UserRegistrationRequest> validator = null,
            IUserAuthRepository authRepo = null,
            string contentType = null)
        {
            var requestContext = new BasicRequest();
            if (contentType != null)
            {
                requestContext.ResponseContentType = contentType;
            }
            var userAuthRepository = authRepo ?? GetStubRepo();
            var service = new UserRegistrationService
            {
                UserRegistrationRequestValidator = validator ?? new UserRegistrationRequestValidator { UserAuthRepo = userAuthRepository },
                AuthRepo = userAuthRepository,
                Request = requestContext,
            };

            HostContext.Container.Register(userAuthRepository);

            return service;
        }
开发者ID:ryandavidhartman,项目名称:Auth404,代码行数:22,代码来源:UserRegistrationServiceTest.cs


示例19: PublishNext

        public void PublishNext()
        {
            if (!Enabled)
                return;

            var message = new BasicRequest {CorrelationId = Guid.NewGuid()};

            if (Published != null) Published(this, null);

            _serviceBus.PublishRequest(message, rc =>
            {
                rc.SetTimeout(30.Seconds());
                rc.Handle<BasicResponse>(x =>
                {
                    if (ResponseHandled != null) ResponseHandled(this, null);

                    System.Threading.Thread.Sleep(1000);
                });
            });

            PublishNext();
        }
开发者ID:withakay,项目名称:MassTransitReqRespTest,代码行数:22,代码来源:Task.cs


示例20: Can_assign_roles_that_persist_to_UserAuthRole_table_in_DynamoDb

        public void Can_assign_roles_that_persist_to_UserAuthRole_table_in_DynamoDb()
        {
            using (var appHost = new BasicAppHost
            {
                ConfigureContainer = container =>
                {
                    container.Register<IPocoDynamo>(c => new PocoDynamo(DynamoConfig.CreateDynamoDBClient()));
                    //DynamoMetadata.Reset();
                    container.Resolve<IPocoDynamo>().DeleteAllTables(TimeSpan.FromMinutes(1));

                    container.Register<IAuthRepository>(c => new DynamoDbAuthRepository(c.Resolve<IPocoDynamo>()));
                    container.Resolve<IAuthRepository>().InitSchema();
                }
            }.Init())
            {
                var db = appHost.Container.Resolve<IPocoDynamo>();

                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.GetItem<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"));

                Assert.That(userAuth.Roles.Count, Is.EqualTo(0));
                Assert.That(userAuth.Permissions.Count, Is.EqualTo(0));

                var manageRoles = (IManageRoles)appHost.Container.Resolve<IAuthRepository>();
                Assert.That(manageRoles.HasRole(userAuth.Id.ToString(), "TestRole"));
                Assert.That(manageRoles.HasPermission(userAuth.Id.ToString(), "TestPermission"));

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

                Assert.That(!manageRoles.HasRole(userAuth.Id.ToString(), "TestRole"));
                Assert.That(!manageRoles.HasPermission(userAuth.Id.ToString(), "TestPermission"));
            }
        }
开发者ID:CLupica,项目名称:ServiceStack,代码行数:51,代码来源:ManageRolesTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Basket类代码示例发布时间:2022-05-24
下一篇:
C# BasicNetwork类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap