Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rihab 104 posts 388 karma points
    Aug 22, 2019 @ 09:28
    Rihab
    0

    Zone.UmbracoMapper With multi Languages properties

    Hi Everyone,

    I'm starting to use Umbraco mapper with Umbraco V8.1.3... I have content with "name" that multi-language and "icon", the icon property is always null unless I Allow varying by culture!!

    this is my code:

       var content = Umbraco.Content(Helper.CategoryContentId);
                var result = new List<CategoryDto>();
                var mapper = new UmbracoMapper();
                mapper.MapCollection(content.ChildrenForAllCultures, result, lan, new Dictionary<string, PropertyMapping>
                    {
                        {
                             "CategoryName", new PropertyMapping
                                {
                                    SourceProperty = CatrgoryProperties.categoryName
    
                                }
                        },
                        {
                             "Icon", new PropertyMapping
                                {
                                    SourceProperty = CatrgoryProperties.iconName,
                                    SourceRelatedProperty = "Url"
                                }
                        }
                    });
    
                return Ok(result);
    

    is there a way to get icon property ?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies