/// <summary>
        /// Returns a Roslyn syntax for the property.
        /// </summary>
        /// <param name="makePublic">Controls whether to make the property public or not.</param>
        internal PropertyDeclarationSyntax ToSyntax(bool makePublic = false)
        {
            var declaration = PropertyDeclaration(Type.ToSyntax(), Identifier(Name));

            if (makePublic)
            {
                declaration = declaration.AddModifiers(Token(SyntaxKind.PublicKeyword));
            }

            declaration = declaration.WithAttributeLists(List(Attributes.Select(x => x.ToSyntax())))
                          .WithDocumentation(Summary);

            if (GetterExpression != null)
            {
                if (Initializer != null)
                {
                    throw new InvalidOperationException($"{nameof(GetterExpression)} and {nameof(Initializer)} may not be both set for the same {nameof(CSharpProperty)}.");
                }

                if (HasSetter)
                {
                    throw new InvalidOperationException($"{nameof(GetterExpression)} and {nameof(HasSetter)} may not be both set for the same {nameof(CSharpProperty)}.");
                }

                declaration = declaration.WithExpressionBody(ArrowExpressionClause(GetterExpression.ToInvocationSyntax()))
                              .WithSemicolonToken(Token(SyntaxKind.SemicolonToken));
            }
            else
            {
                var accessors = new List <SyntaxKind> {
                    SyntaxKind.GetAccessorDeclaration
                };
                if (HasSetter)
                {
                    accessors.Add(SyntaxKind.SetAccessorDeclaration);
                }

                declaration = declaration.WithAccessorList(AccessorList(List(
                                                                            accessors.Select(x => AccessorDeclaration(x).WithSemicolonToken(Token(SyntaxKind.SemicolonToken))))));
            }

            if (Initializer != null)
            {
                declaration = declaration.WithInitializer(EqualsValueClause(Initializer.ToInvocationSyntax()))
                              .WithSemicolonToken(Token(SyntaxKind.SemicolonToken));
            }

            return(declaration);
        }