Aqueduct.SitecoreLib.DataAccess.ValueResolvers.ImageValueResolver.ResolveEntityPropertyValue C# (CSharp) Method

ResolveEntityPropertyValue() public method

public ResolveEntityPropertyValue ( string rawValue, Type propertyType ) : object
rawValue string
propertyType System.Type
return object
        public object ResolveEntityPropertyValue(string rawValue, Type propertyType)
        {
            if (rawValue.IsNotEmpty())
            {
                Match imageMatch = Regex.Match(rawValue, RegexPattern);
                if (imageMatch.Success && imageMatch.Groups["imageid"].Value.IsGuid())
                {
                    Guid imageId = new Guid(imageMatch.Groups["imageid"].Value);
                    ReadOnlyRepository repository = new ReadOnlyRepository();
                    return repository.Get<Image>(imageId);
                }
            }

            return null;
        }