protected ParameterBase(object?value) { if (value != null) { var type = value.GetType(); if (!CodeGeneratorConfigurationUtility.IsAllowedConstantType(type)) { throw new ArgumentException($"{type.FullName} is not an allowed type for an attribute parameter."); } } Value = value; }
public Constant(string name, object?value) { if (value != null) { var type = value.GetType(); if (!CodeGeneratorConfigurationUtility.IsAllowedConstantType(type)) { throw new ArgumentException($"{type.FullName} is not an allowed type for a constant in a 'ThisAssembly' class."); } } Name = name; Value = value; }