<p dir="auto">Hi,<br>
Please make typescript auto-property support like C# to easier use.</p>
<p dir="auto">Thanks.</p>
<p dir="auto">When you're creating a class and you want to define some properties you have to write much code to do so.<br>
<strong>Current way</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyClass {

    /**
     * Creates a new Instance of this class
     */
    constructor(private _id: number, private _name: string) {
    }

    /**
     * To define a property, you need a get function ...
     */
    get id(): number {
        return this._id;
    }

    /**
     * ... and a set function ...
     */
    set id(value: number) {
        this._id= value;
    }

    /**
     * ... for every single ...
     */
    get name(): string {
        return this._name;
    }

    /**
     * ... property.
     */
    set name(value: string) {
        if (this.checkName(value)) {
           this._name = value;
        }
    }

    /**
     * Do something
     */
    private checkName(name: string): boolean {
         return name &amp;&amp; name.trim();
    }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">MyClass</span> <span class="pl-kos">{</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * Creates a new Instance of this class</span>
<span class="pl-c">     */</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-k">private</span> <span class="pl-s1">_id</span>: <span class="pl-smi">number</span><span class="pl-kos">,</span> <span class="pl-k">private</span> <span class="pl-s1">_name</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-kos">}</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * To define a property, you need a get function ...</span>
<span class="pl-c">     */</span>
    <span class="pl-k">get</span> <span class="pl-en">id</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">number</span> <span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_id</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * ... and a set function ...</span>
<span class="pl-c">     */</span>
    <span class="pl-k">set</span> <span class="pl-en">id</span><span class="pl-kos">(</span><span class="pl-s1">value</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_id</span><span class="pl-c1">=</span> <span class="pl-s1">value</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * ... for every single ...</span>
<span class="pl-c">     */</span>
    <span class="pl-k">get</span> <span class="pl-en">name</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">string</span> <span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_name</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * ... property.</span>
<span class="pl-c">     */</span>
    <span class="pl-k">set</span> <span class="pl-en">name</span><span class="pl-kos">(</span><span class="pl-s1">value</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">checkName</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
           <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_name</span> <span class="pl-c1">=</span> <span class="pl-s1">value</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * Do something</span>
<span class="pl-c">     */</span>
    <span class="pl-k">private</span> <span class="pl-en">checkName</span><span class="pl-kos">(</span><span class="pl-s1">name</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">boolean</span> <span class="pl-kos">{</span>
         <span class="pl-k">return</span> <span class="pl-s1">name</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">name</span><span class="pl-kos">.</span><span class="pl-en">trim</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Please consider to add additional ways to define properties, similar to C# where you also have more than one way.</p>
<p dir="auto"><strong>Additional ways in a future release</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MySecondClass {
    /**
     * Creates a new Instance of this class
     */
    constructor(id: number, private _name: string) {
        this.id = id;
    }

    /**
     * Define a property in only one line
     */
    public id(): number { get; set; }

    /**
     * Define a property with additional functionallity
     */
    public name(): string {
        get { return this._name; }
        set { 
           if (this.checkName(value)) {
              this._name = value; 
           }
        }
    }

    /**
     * Do something
     */
    private checkName(name: string): boolean {
         return name &amp;&amp; name.trim();
    }
}
"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-smi">MySecondClass</span> <span class="pl-kos">{</span>
    <span class="pl-c">/**</span>
<span class="pl-c">     * Creates a new Instance of this class</span>
<span class="pl-c">     */</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">id</span>: <span class="pl-smi">number</span><span class="pl-kos">,</span> <span class="pl-k">private</span> <span class="pl-s1">_name</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">id</span> <span class="pl-c1">=</span> <span class="pl-s1">id</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * Define a property in only one line</span>
<span class="pl-c">     */</span>
    <span class="pl-k">public</span> <span class="pl-en">id</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">number</span> <span class="pl-kos">{</span> <span class="pl-s1">get</span><span class="pl-kos">;</span> <span class="pl-s1">set</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * Define a property with additional functionallity</span>
<span class="pl-c">     */</span>
    <span class="pl-k">public</span> <span class="pl-en">name</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">string</span> <span class="pl-kos">{</span>
        <span class="pl-k">get</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_name</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
        <span class="pl-k">set</span> <span class="pl-kos">{</span> 
           <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">checkName</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
              <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">_name</span> <span class="pl-c1">=</span> <span class="pl-s1">value</span><span class="pl-kos">;</span> 
           <span class="pl-kos">}</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">}</span>

    <span class="pl-c">/**</span>
<span class="pl-c">     * Do something</span>
<span class="pl-c">     */</span>
    <span class="pl-k">private</span> <span class="pl-en">checkName</span><span class="pl-kos">(</span><span class="pl-s1">name</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span>: <span class="pl-smi">boolean</span> <span class="pl-kos">{</span>
         <span class="pl-k">return</span> <span class="pl-s1">name</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">name</span><span class="pl-kos">.</span><span class="pl-en">trim</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>