﻿---
title: csharp_style_expression_bodied_properties
description: Convert an eligible single-getter property to an expression body. IDE0025. Defaults to `false`
url: https://docs-v3-preview.elastic.dev/reference/expression-bodies/csharp_style_expression_bodied_properties
---

# csharp_style_expression_bodied_properties
Convert an eligible single-getter property to an expression body. IDE0025.

## Values


| Value                 | Notes |
|-----------------------|-------|
| `false`               |       |
| `true`                |       |
| `when_on_single_line` |       |

**Default:** `false`

### `csharp_style_expression_bodied_properties = false`

```ini
csharp_style_expression_bodied_properties = false
```

<tab-set>
  <tab-item title="Before">
    ```csharp
    namespace N;

    public class Widget
    {
        private int _value;

        public int Value
        {
            get { return _value; }
        }

        public string Name
        {
            get { return "widget"; }
        }
    }
    ```
  </tab-item>

  <tab-item title="After">
    ```csharp
    namespace N;

    public class Widget
    {
        private int _value;

        public int Value { get { return _value; } }

        public string Name { get { return "widget"; } }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_style_expression_bodied_properties = true`

```ini
csharp_style_expression_bodied_properties = true
```

<tab-set>
  <tab-item title="Before">
    ```csharp
    namespace N;

    public class Widget
    {
        private int _value;

        public int Value { get { return _value; } }

        public string Name { get { return "widget"; } }
    }
    ```
  </tab-item>

  <tab-item title="After">
    ```csharp
    namespace N;

    public class Widget
    {
        private int _value;

        public int Value => _value;

        public string Name => "widget";
    }
    ```
  </tab-item>
</tab-set>


### `csharp_style_expression_bodied_properties = when_on_single_line`

```ini
csharp_style_expression_bodied_properties = when_on_single_line
```

<tab-set>
  <tab-item title="Before">
    ```csharp
    namespace N;

    public class Widget
    {
        private int _value;

        public int Value { get { return _value; } }

        public string Name { get { return "widget"; } }
    }
    ```
  </tab-item>

  <tab-item title="After">
    ```csharp
    namespace N;

    public class Widget
    {
        private int _value;

        public int Value { get { return _value; } }

        public string Name { get { return "widget"; } }
    }
    ```
  </tab-item>
</tab-set>