public override CodeAttributeDeclaration GetAttribute() { var a = new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference(typeof(StringLengthAttribute), Configuration), new CodeAttributeArgument(Max > 0 ? (CodeExpression) new CodePrimitiveExpression(Max) : new CodeSnippetExpression("int.MaxValue"))); if (Min > 0) { a.Arguments.Add(new CodeAttributeArgument("MinimumLength", new CodePrimitiveExpression(Min))); } return(a); }
public override CodeAttributeDeclaration GetAttribute() { return(new CodeAttributeDeclaration(CodeUtilities.CreateTypeReference(typeof(RegularExpressionAttribute), Configuration), new CodeAttributeArgument(new CodePrimitiveExpression(Value)))); }