# Object

## SetProperty

Sets property of source instance to specified value. When property with provided name doesn't exist then nothing happens.

```csharp
var foo = new Foo { BarProperty = new Bar() };
foo.SetProperty("BarProperty.BarId", 9); // sets value of nested property BarId to 9
```

## Dump

Dumps all object's properties into string for specified count of levels depth.

```csharp
var foo = new Foo
{
    Id = 1,
    BarProperty = new Bar
    {
        BarId = 2,
        BazProperty = new Baz
        {
            BazId = 3,
            BazName = "SomeBaz"
        }
    },
    Flag = true
};
var result = foo.Dump(3);

// results in:
// {Structr.Tests.Abstractions.Extensions.ObjectExtensionsTests+Foo(HashCode:31071611)}
//   Id: 1
//   BarProperty: { }
//     {Structr.Tests.Abstractions.Extensions.ObjectExtensionsTests+Bar(HashCode:63566392)}
//       BarId: 2
//       BazProperty: { }
//   Flag: True
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.structr.dev/utilities/abstractions/extensions/object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
