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