43 references to NullabilityState
Microsoft.Extensions.AI.Abstractions (43)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (3)
284(property.Get is null || nullabilityInfo.ReadState is NullabilityState.NotNull) && 285(property.Set is null || nullabilityInfo.WriteState is NullabilityState.NotNull); 711isNonNullable = ReflectionHelpers.GetParameterNullability(nullabilityInfoContext, parameter) is NullabilityState.NotNull;
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (1)
185public static NullabilityState GetParameterNullability(NullabilityInfoContext context, ParameterInfo parameterInfo)
src\Shared\JsonSchemaExporter\NullabilityInfoContext\NullabilityInfo.cs (4)
17internal NullabilityInfo(Type type, NullabilityState readState, NullabilityState writeState, 36public NullabilityState ReadState { get; internal set; } 41public NullabilityState WriteState { get; internal set; }
src\Shared\JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (35)
29private readonly Dictionary<MemberInfo, NullabilityState> _context = new(); 39private NullabilityState? GetNullableContext(MemberInfo? memberInfo) 43if (_context.TryGetValue(memberInfo, out NullabilityState state)) 82if (nullability.ReadState != NullabilityState.Unknown) 147var codeAnalysisReadState = NullabilityState.Unknown; 148var codeAnalysisWriteState = NullabilityState.Unknown; 156codeAnalysisReadState = NullabilityState.NotNull; 160codeAnalysisReadState == NullabilityState.Unknown && 163codeAnalysisReadState = NullabilityState.Nullable; 167codeAnalysisWriteState = NullabilityState.NotNull; 170codeAnalysisWriteState == NullabilityState.Unknown && 173codeAnalysisWriteState = NullabilityState.Nullable; 178if (codeAnalysisReadState != NullabilityState.Unknown) 183if (codeAnalysisWriteState != NullabilityState.Unknown) 212nullability.ReadState = NullabilityState.Unknown; 221nullability.WriteState = NullabilityState.Unknown; 328if (nullability.ReadState != NullabilityState.Unknown) 338NullabilityState state = NullabilityState.Unknown; 353state = NullabilityState.Nullable; 357state = NullabilityState.NotNull; 452if (nullability.ReadState == NullabilityState.NotNull) 498var state = NullabilityState.Unknown; 584var state = NullabilityState.Unknown; 614private static NullabilityState TranslateByte(object? value) 616return value is byte b ? TranslateByte(b) : NullabilityState.Unknown; 619private static NullabilityState TranslateByte(byte b) => 6221 => NullabilityState.NotNull, 6232 => NullabilityState.Nullable, 624_ => NullabilityState.Unknown 643public bool ParseNullableState(int index, ref NullabilityState state)