예제 #1
0
        public static string CreateFullNameWithNullableIfEnable(this SemanticTypeGenerator.Input input)
        {
            string result;

            if (!input.IsValueType)
            {
                result = input.ActualTypeFullName;
                if (input.IsNullableType)
                {
                    result += "?";
                }
            }
            else
            {
                result = input.ActualTypeFullName;
            }

            return(result);
        }
예제 #2
0
 public static bool IsRelevantForNullability(this SemanticTypeGenerator.Input input) => !input.IsValueType && input.IsNullableType;
예제 #3
0
        public static TypeSyntax MakeNullableIfEnabledButNotIfStruct(this TypeSyntax typeSyntax, SemanticTypeGenerator.Input input)
        {
            var result = input.IsValueType ? typeSyntax : (input.IsNullableType ? NullableType(typeSyntax) : typeSyntax);

            return(result);
        }
예제 #4
0
 public static TypeSyntax MakeNullableIfEnabled(this TypeSyntax typeSyntax, SemanticTypeGenerator.Input input)
 {
     return(input.IsNullableEnabled ? NullableType(typeSyntax) : typeSyntax);
 }