Copied to clipboard

Flag this post as spam?

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


  • Earnest 1 post 71 karma points
    Sep 20, 2016 @ 16:08
    Earnest
    0

    Sequence contains more than one matching element

    Hi all,

    I'm getting an Exception Message: Sequence contains more than one matching element.

    Here is my StackTrace:

    {"Message":"An error has occurred.","ExceptionMessage":"Sequence contains more than one matching element","ExceptionType":"System.InvalidOperationException","StackTrace":" at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate)\r\n at Umbraco.Web.Models.Mapping.TabsAndPropertiesResolver.ResolveCore(IContentBase content)\r\n at AutoMapper.ValueResolver2.Resolve(ResolutionResult source)\r\n at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable1 source, TAccumulate seed, Func`3 func)\r\n at AutoMapper.Mappers.TypeMapObjectMapperRegistry.PropertyMapMappingStrategy.MapPropertyValue(ResolutionContext context, IMappingEngineRunner mapper, Object mappedObject, PropertyMap propertyMap)"}

    Thanks to all who can help in advance!

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Oct 11, 2016 @ 17:23
    Alex Skrypnyk
    0

    Hi Earnest,

    It's because Single method should return only one item and in your case there are few.

    Can you use First() or Last() instad of Single()?

    Also please share code with us we will help you.

    Thanks,

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft