本文整理汇总了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));
}
示例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;
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
示例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");
}