public T GetValue()

in src/JetBrains.Space.Common/Types/Partials/PropertyValue.cs [75:106]


    public T GetValue(IEnumerable<ApiInlineError> inlineErrors)
    {
        if (_validateHasBeenSet)
        {
            // Is there a known inline error?
            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            if (inlineErrors != null)
            {
                foreach (var inaccessibleFields in inlineErrors.OfType<ApiInlineErrorInaccessibleFields>())
                {
                    if (inaccessibleFields.Fields.Contains(_fieldName))
                    {
                        throw new PropertyValueInaccessibleException(
                            message: $"{inaccessibleFields.Message.TrimEnd('.')}. Property {_propertyName} on {_className} is not accessible.", 
                            typeName: _className, 
                            propertyName: _propertyName);
                    }
                }
            }
            
            // Has the property not been set?
            if (!_hasBeenSet) 
            {
                throw new PropertyNotRequestedException(
                    message: $"The property {_propertyName} was not requested in the partial builder for {_className}. Use .With{_propertyName}() to include it. Expected full path: {_accessPath}.With{_propertyName}()",
                    typeName: _className,
                    propertyName: _propertyName);                
            }
        }

        return _value;
    }