刚开始使用这个很棒的 api,我遇到了多个DependentRules. 我有这样的规则
RuleFor(d => d.NotificationType).NotEmpty().WithMessage("Required");
When(d => d.NotificationType.ToUpper() == "EMAIL", () =>
{
RuleFor(d => d.NotificationEmail).EmailAddress().WithMessage("Invalid Email Address");
RuleFor(d => d.NotificationEmail).NotEmpty().WithMessage("Required");
});
When(d => d.NotificationType.ToUpper() == "SMS", () =>
{
RuleFor(d => d.NotificationContactNo).NotEmpty().WithMessage("Required");
});
Run Code Online (Sandbox Code Playgroud)
但是,当失败NotificationType时Empty,它已经提出了Required错误。现在在这种情况下,这些其他规则是依赖规则,它们应该只在NotificationType不为空时执行。为此,我将规则修改为:
RuleFor(d => d.NotificationType).NotEmpty().WithMessage("Required").DependentRules(k =>
k.When(d => d.NotificationType.ToUpper() == "EMAIL", () =>
{
RuleFor(d => d.NotificationEmail).EmailAddress().WithMessage("Invalid Email Address");
RuleFor(d => d.NotificationEmail).NotEmpty().WithMessage("Required");
})
);
RuleFor(d => d.NotificationType).NotEmpty().WithMessage("Required").DependentRules(k =>
When(d => d.NotificationType.ToUpper() == "SMS", () =>
{ …Run Code Online (Sandbox Code Playgroud) 我正在 MVC4 中开发一个旅行社网站,该网站使用 Travelport 进行航班查询、定价和预订。它工作正常,直到我继续确认航空预订。它抛出这个异常
Message From Galileo : Uncaught Service Exception cause:com.cendant.tds.soa.framework.ServiceException: Exception ReturnedERR: AGENT ID - GALILEO
|+With the Dynamic GTID list of:AF86B8
Run Code Online (Sandbox Code Playgroud)
这是我在请求中设置的代理信息
AgentAction agentaction = new AgentAction()
{
ActionType = AgentActionActionType.Created,
AgentCode = "My Agent Code",
BranchCode = "My Branch Code",
AgencyCode = "My Agency Code",
EventTime = DateTime.Now
};
Run Code Online (Sandbox Code Playgroud)
也尝试设置AgentIDOverride但仍然遇到相同的异常。谁能指导我如何解决这个问题?提前致谢
UDP日期
这是 SOAPException 内部外部 XML
<!-- INNER XML -->
<common_v27_0:ErrorInfo xmlns:common_v27_0=\"http://www.travelport.com/schema/common_v27_0\">
<common_v27_0:Code>some numeric code</common_v27_0:Code>
<common_v27_0:Service>AIRSVC</common_v27_0:Service>
<common_v27_0:Type>Business</common_v27_0:Type>
<common_v27_0:Description>Unsuccessful primary host transaction causing reservation failure.</common_v27_0:Description> …Run Code Online (Sandbox Code Playgroud) 我正在使用Visual Studio 2008进行编程,并使用带有C#的.NET Framework 3.5制作Web应用程序.所有DAL都与强大的实体框架包装器链接(类似于VS.net 2010将使用的那个.)我有一个用于搜索first和lastname的文本框.我遇到的问题是我正在使用AJAX Control Toolkit 2.0,它提供了一个Auto complete extender,但是,通过使用WebServices(asmx).有没有其他方法可以在不使用Web服务的情况下使用自动完成功能?
问候,
西蒙
Ps:对不起我的英文,我尽我所能:)!