Type Summary

						public sealed class ObsoleteAttribute : Attribute
{
  // Constructors
     public ObsoleteAttribute ();
     public ObsoleteAttribute (string message);
     public ObsoleteAttribute (string message,
                               bool error);

  // Properties
     public bool IsError { get; }
     public string Message { get; }
}

BA You'll notice that this attribute is sealed. In general I am not a huge fan of sealing classes by default, but for custom attributes that you expect to be looked up at runtime it is a good idea to seal them, because then reflection can use a slightly faster code path to look them up.

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.