Copied to clipboard

Flag this post as spam?

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


  • Mani 11 posts 111 karma points
    Jul 13, 2023 @ 15:50
    Mani
    0

    ViewComponent Model failed to retrieve <Guid>("key") property value

    I have a ViewComponent Model from where I want to retrieve a number of properties, which I successfully do but the "Key" (alias "key") fails to yield the desired value and instead it gives me a bunch of zeros. When running on debug, I can see the Guid value of the key property is indeed there, but it never assigns it, here is the snippet:

    "public Guid ModuleId => _blockListItem.Content.Value

    Has anyone come across this?

    Thank you in advance,

    Manienter image description here

  • Mani 11 posts 111 karma points
    Jul 14, 2023 @ 08:44
    Mani
    0

    I just want to add the following:

    In the image there is a field below the "Key" and "Static members" labelled "Empty" and against it the value is a bunch of zeros {00000000-0000-0000-0000-000000000000} that is what I get instead of the Key value

  • Huw Reddick 1740 posts 6102 karma points MVP c-trib
    Jul 14, 2023 @ 09:47
    Huw Reddick
    0

    Hi Mani,

    Have you tried _blockListItem.Content.Key ?

  • Mani 11 posts 111 karma points
    Jul 14, 2023 @ 12:44
    Mani
    0

    Hi Huw,

    It never occured to me to do that, but it worked :)

    Thank you so much!

    Mani

Please Sign in or register to post replies

Write your reply to:

Draft