Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ExpressiveAnnotations:在RequiredIfAttribute中翻译全局_defaultErrorMessage_C#_Translation_Expressiveannotations - Fatal编程技术网

C# ExpressiveAnnotations:在RequiredIfAttribute中翻译全局_defaultErrorMessage

C# ExpressiveAnnotations:在RequiredIfAttribute中翻译全局_defaultErrorMessage,c#,translation,expressiveannotations,C#,Translation,Expressiveannotations,我想对assertthattattribute和RequiredIfAttribute使用继承,但不可能,因为这两个类都是密封的类 public sealed class RequiredIfAttribute : ExpressiveAttribute public sealed class AssertThatAttribute : ExpressiveAttribute 是否有其他可能翻译全局udefaultErrorMessage 例如: private const string _d

我想对
assertthattattribute
RequiredIfAttribute
使用继承,但不可能,因为这两个类都是
密封的

public sealed class RequiredIfAttribute : ExpressiveAttribute
public sealed class AssertThatAttribute : ExpressiveAttribute
是否有其他可能翻译全局u
defaultErrorMessage

例如:

private const string _defaultErrorMessage = "Assertion for {0} field is not satisfied by the following logic: {1}";

我想为整个项目进行全球翻译。有可能吗?

可能您已经看到了这一点以及相关的pull请求,最简单的解决方案是在上面提供的链接下释放所需的RediftTribute。我刚刚添加了一个
ExpressiveAttribute
继承的示例(还需要一些额外的步骤来连接它).作为一个评论,我可以接受它只是为了提供信息。代码以前是有效的,但新版本后我不能再使用翻译消息了。现在总是用英语。为什么?发生了什么变化?