Skip to content

Type Coercion helper to provide Coercion Function given a type #2882

@MikeStall

Description

@MikeStall

Have a helper that provides the appropriate coercion function for each type.
Ie, avoid people having to write this:

    // Coercion() 
    if (fieldType == FormulaType.String)
    {
        // No coercion needed 
    } else if (fieldType == FormulaType.Number)
    {
        sb.Append("Value");
    }
    else if (fieldType == FormulaType.Guid)
    {
        sb.Append("GUID");
    }
    else if (fieldType == FormulaType.DateTime)
    {
        sb.Append("DateTimeValue");
    }
    else if (fieldType == FormulaType.Date)
    {
        sb.Append("DateValue");
    }
    else if (fieldType == FormulaType.Boolean)
    {
        sb.Append("Boolean");
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions