CSharpProcedural.

GetInitializer(Object) Method

Summary

Tries to return a string which could be used as a C# field initializer to give the field the specified `value`. Returns null if the 'value is null or if unable to determine the appropriate field initializer.

If the value is a custom type with a static string GetInitializer(T value) method, that method will be called to determine the result.

Syntax

public static string GetInitializer(Object value)

Parameters

Name Type Description
value Object

Return Value

Type Description
string