Beispiel #1
0
        internal PropertyPath(PropertyPath propertyPath)
        {
            var last = propertyPath.Last();

            if (last.PropertyInfo.PropertyType != typeof(TValue))
            {
                throw new InvalidOperationException($"Valuepath type does not match. Expected: {typeof(TValue).FullName} was: {last.PropertyInfo.PropertyType.FullName}");
            }

            this.propertyPath = propertyPath;
        }
Beispiel #2
0
        internal PropertyPath(PropertyPath propertyPath, object source)
        {
            var last = propertyPath.Last();

            if (last.PropertyInfo.PropertyType != typeof(TValue))
            {
                var message = $"Valuepath type does not match. Expected: {typeof(TValue).FullName} was: {last.PropertyInfo.PropertyType.FullName}";
                throw new InvalidOperationException(message);
            }

            this.maybe = propertyPath.GetValue <TValue>(source);
        }