【发布时间】:2014-02-07 08:28:04
【问题描述】:
我有两个架构;
src.xsd
destination.xsd
src.xsd 有 2 个日期和 1 个字符串
-FromDate (example: 2001-01-01)
-ToDate (example: 2002-01-01)
-Intervaltype (example: 'A long year')
dest.xsd 有 1 个字符串属性
-Query
我想对此进行映射,以便在目标架构的 Query 属性中实现串联字符串,例如:
"WHERE date1 >= 2001-01-01 AND date2 <= ToDate AND IntervalDescription = 'A long year'"
我通过使用“字符串连接”functoid 实现了这一点。
问题是日期是可选的,如果 src.xsd 中没有提供任何日期,我想在映射中设置“默认”值。在那种情况下,我想
FromDate to be the current date - 10days
和
ToDate to be de current date
如何做到这一点?
感谢您的帮助!
【问题讨论】:
-
只需使用带有 3 个输入参数的内联 C# 脚本函数并使用标准 C# 方法来操作字符串。 msdn.microsoft.com/en-us/library/ee267841(v=bts.10).aspx