# Class TextContent

Namespace
  AnthropicClient.Models

Assembly
  AnthropicClient.dll

Represents text content that is part of a message.

    public class TextContent : Content

Inheritance
  object
  Content
  TextContent

Inherited Members
  Content.Type
  Content.CacheControl
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Constructors

### TextContent(string)

Initializes a new instance of the TextContent class.

    public TextContent(string text)

#### Parameters

`text` string

  The text of the content.

#### Exceptions

ArgumentNullException

  Thrown when the text is null.

### TextContent(string, CacheControl)

Initializes a new instance of the TextContent class.

    public TextContent(string text, CacheControl cacheControl)

#### Parameters

`text` string

  The text of the content.

`cacheControl` CacheControl

  The cache control to be used for the content.

#### Exceptions

ArgumentNullException

  Thrown when the text or cache control is null.

## Properties

### Text

Gets the text of the content.

    public string Text { get; init; }

#### Property Value

string