Similar considerations apply if we change the type of the first parameter from String to int.
如果将第一个参数的类型从 String 变成 int ,那么也得考虑相同的问题。
Assign is only available for assigning a value to simple type fields, such as string and int. To create an assign mapping.
Assign只能用于为简单类型字段指定值,比如字符串和整数。
In this case, you can use a Convert to ensure that the string age, which is expected, but not required to be an int, is actually an int in the target.
对于这种情况,您可以使用Convert来确保字符串格式的年龄(预期的值,但不一定要为整数值)在目标中为一个整数值。
And we'll see if you try to mess with our functions by providing a string when we want an int, or providing an int when we want a string, you may very well get yelled at and the user will have to retry.
我们可以看到,如果你尝试打乱我们的函数,当想要一个int数时我们提供sting型,或者,当想要一个sting数时我们提供int型,你可能会被吼叫,然后用户不得不重新尝试。
int So whereas before I mentioned int, turns out if you wanna put a string in a variable, you have to say this is a string.
先不管我之前提到的,如果你想把一个字符串赋给某个变量,那你必须事先声明这个变量是string类型的。
应用推荐