Exemplo n.º 1
0
    public virtual void GenerateMigrationProperty(
        StringBuilder source, Compilation compilation, string indent, SerializableProperty serializableProperty
        )
    {
        var propertyType = serializableProperty.Type;
        var type         = compilation.GetTypeByMetadataName(propertyType)?.IsValueType == true ||
                           SymbolMetadata.IsPrimitiveFromTypeDisplayString(propertyType) && propertyType != "bool"
            ? $"{propertyType}{(serializableProperty.UsesSaveFlag == true ? "?" : "")}" : propertyType;

        source.AppendLine($"{indent}internal readonly {type} {serializableProperty.Name};");
    }
Exemplo n.º 2
0
 // TODO: Extract as extension method
 public SymbolSyntaxElement(SyntaxToken token, SymbolMetadata metadata)
     : base(token, SyntaxElementKind.Identifier)
 {
     TrackingId = metadata.Id;
     SymbolKind = metadata.SymbolKind;
 }