You often use anonymous types to store some subset of data from another object. In many cases, you’re interested in only a subset of the properties present in the original object. With an anonymous type, you get a new object containing only the properties that you care about.

In the example below, the dogInfo object declaration creates an anonymous type containing only two of the properties present in the Dog object that it is referring to. These properties, as they exist in the new object, are read-only.