Copied to clipboard

Flag this post as spam?

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


  • marcelh 171 posts 471 karma points
    Mar 20, 2015 @ 16:54
    marcelh
    0

    DataTypeService.GetPreValueAsString throws InvalidOperationException (Sequence contains no matching elelement)

    I'm using the DataTypeService to get the "nice text" (GetPreValueAsString) for a selected dropdownlist item. But on the first load of the website, I receive the following YSOD:

    [InvalidOperationException: Sequence contains no matching element] System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +621 Umbraco.Core.Persistence.Repositories.DataTypeDefinitionRepository.GetPreValueAsString(Int32 preValueId) +300 Umbraco.Core.Services.DataTypeService.GetPreValueAsString(Int32 id) +105

    It looks as if something is not completely initialized when the call to the DataTypeService is invoked, because I only receive this message on the first run (after building). When I access the Umbraco backend in another page and then switch back to the actual page, the page loads just fine.

    I should perhaps not that I'm using Zbu's ModelBuilder to generate strongtyped models for my document types (which works just fine). Within one of these models, there's a property that uses the DataTypeService to retrieve the "nice text" for the selected value.

    Note that I posted this issue also here, but perhaps you guys have seen this before.

Please Sign in or register to post replies

Write your reply to:

Draft