Aqueduct.SitecoreLib.DataAccess.ValueResolvers.NullableResolver.ResolveEntityPropertyValue C# (CSharp) Метод

ResolveEntityPropertyValue() публичный Метод

public ResolveEntityPropertyValue ( string rawValue, Type propertyType ) : object
rawValue string
propertyType System.Type
Результат object
        public object ResolveEntityPropertyValue(string rawValue, Type propertyType)
        {
            Type argumentType = ResolverHelper.GetArgumentType (propertyType);
            Type nullableType = typeof(Nullable<>);

            if (!string.IsNullOrEmpty (rawValue))
            {
                object value = GetObjectValue (rawValue, argumentType);
                if (value != null)
                {
                    Type type = nullableType.MakeGenericType(argumentType);
                    return Activator.CreateInstance (type, value);
                }
            }

            return ResolverHelper.CreateGenericClassInstance (nullableType, argumentType);
        }