title: Roslyn (Lambda) Expression Bodied Property Syntax
body: <p>I wrote a function to convert LocalDeclaration's to Global Resources.  Right now I'm replacing with each definition with a property, but I want to replace it with a property using the new syntax =></p>
  
  <pre><code>    public PropertyDeclarationSyntax ConvertToResourceProperty(string resouceClassIdentifier, string fieldName, string resourceKey, CSharpSyntaxNode field)
      {
          var stringType = SyntaxFactory.ParseTypeName("string");
  
          var resourceReturnIdentifier = SyntaxFactory.IdentifierName(resouceClassIdentifier + "." + resourceKey);
          var returnResourceStatement = SyntaxFactory.ReturnStatement(resourceReturnIdentifier).NormalizeWhitespace();
          var getRescourceBlock = SyntaxFactory.Block(returnResourceStatement);
  
          var getAccessor = SyntaxFactory.AccessorDeclaration(SyntaxKind.GetAccessorDeclaration, getRescourceBlock).WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);
  
          var propertyDeclaration = SyntaxFactory.PropertyDeclaration(stringType, fieldName).AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword)).NormalizeWhitespace();
  
          propertyDeclaration = propertyDeclaration.AddAccessorListAccessors(getAccessor).WithAdditionalAnnotations(Formatter.Annotation);
  
          SyntaxTrivia[] leadingTrivia = field.GetLeadingTrivia().ToArray() ?? new[] { SyntaxFactory.Whitespace("\t") };
          return propertyDeclaration.WithTrailingTrivia(SyntaxFactory.Whitespace("\r\n"))
                      .WithLeadingTrivia(leadingTrivia)
                      .WithAdditionalAnnotations(Simplifier.Annotation);
      }
  </code></pre>
  
  <p>This code create a property like so:</p>
  
  <pre><code>public static string LocalResourceName
  {
      get{ return Resources.LocalResourceName; }
  }
  </code></pre>
  
  <p>I would like it to make the property like so:</p>
  
  <pre><code>public static string LocalResourceName =&gt;Resources.LocalResourceName;
  </code></pre>
  
  <p>I'm not too sure what will create an expression bodied property from the syntaxfactory? Can anyone point me to the right method?</p>