| | | 1 | | namespace NexusLabs.Needlr.AgentFramework.Generators.Models |
| | | 2 | | { |
| | | 3 | | /// <summary> |
| | | 4 | | /// Describes a single property on the value type that the generated |
| | | 5 | | /// <c>[AsyncLocalScoped]</c> accessor should proxy through to |
| | | 6 | | /// <c>Current?.PropertyName</c>. |
| | | 7 | | /// </summary> |
| | | 8 | | internal readonly struct AsyncLocalScopedPropertyInfo |
| | | 9 | | { |
| | | 10 | | public AsyncLocalScopedPropertyInfo( |
| | | 11 | | string name, |
| | | 12 | | string typeFullName, |
| | | 13 | | bool hasSetter, |
| | | 14 | | bool isNonNullableValueType) |
| | | 15 | | { |
| | 8 | 16 | | Name = name; |
| | 8 | 17 | | TypeFullName = typeFullName; |
| | 8 | 18 | | HasSetter = hasSetter; |
| | 8 | 19 | | IsNonNullableValueType = isNonNullableValueType; |
| | 8 | 20 | | } |
| | | 21 | | |
| | | 22 | | /// <summary>The property name (e.g., "Title").</summary> |
| | 21 | 23 | | public string Name { get; } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// The fully-qualified type name of the property, using |
| | | 27 | | /// <c>global::</c> prefix (e.g., "global::System.String?"). |
| | | 28 | | /// </summary> |
| | 8 | 29 | | public string TypeFullName { get; } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Whether the property has a setter on the value type interface, |
| | | 33 | | /// enabling a write-through proxy. |
| | | 34 | | /// </summary> |
| | 8 | 35 | | public bool HasSetter { get; } |
| | | 36 | | |
| | | 37 | | /// <summary> |
| | | 38 | | /// Whether the property type is a non-nullable value type (e.g., <c>int</c>, |
| | | 39 | | /// <c>bool</c>). When <see langword="true"/>, the generated getter appends |
| | | 40 | | /// <c>?? default</c> to the null-conditional expression to coerce the |
| | | 41 | | /// <c>Nullable<T></c> back to <c>T</c>. |
| | | 42 | | /// </summary> |
| | 8 | 43 | | public bool IsNonNullableValueType { get; } |
| | | 44 | | } |
| | | 45 | | } |