Glass Mapper: не удалось найти средство отображения данных для обработки свойства AbstractPropertyConfiguration Property

После обновления до Glass.Mapper.Sc 3.2.3.50 я получаю:

Не удалось найти сопоставитель данных для обработки свойства AbstractPropertyConfiguration Свойство: Regions Тип: [type].IEventSearch Assembly: [assembly], Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

В строке 23:

Line 21:             //create a context
Line 22:             Context context = Context.Create(resolver);
Line 23:             context.Load(new IConfigurationLoader[]
Line 24:             {
Line 25:                 new EventSearchMap().Load(),

Весь метод:

    public void Process(PipelineArgs args)
    {
        //create the resolver
        DependencyResolver resolver = DependencyResolver.CreateStandardResolver();

        //install the custom services
        var config = new Config();
        resolver.Container.Install(new SitecoreInstaller(config));

        //create a context
        Context context = Context.Create(resolver);
        context.Load(new IConfigurationLoader[]
        {
            new EventSearchMap().Load(),
            new RegionMap().Load(),
            new MunicipalityMap().Load(),
            new SearchMap().Load(),
            new PageMap().Load(),
            new HeaderMap().Load(),
            new SectionMenuMap().Load(),
            new BreadcrumbMap().Load(),
            new NavigationMap().Load(),
            new SitemapMap().Load()
        });
    }

Запустилось здесь:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <pipelines>
      <initialize>
        <processor type="[Type].GlassMapper, [assembly]" />
      </initialize>
    </pipelines>
  </sitecore>
</configuration>

Интерфейс для: IEventSearch

[SitecoreType]
public interface IEventSearch : ISitecoreItem
{
    IEnumerable<IRegion> Regions { get; set; }
    IEnumerable<IMunicipality> Municipalities { get; set; }
}

Класс EventSearchMap:

public class EventSearchMap
{
    public SitecoreFluentConfigurationLoader Load()
    {
        var loader = new SitecoreFluentConfigurationLoader();
        SitecoreType<IEventSearch> type = loader.Add<IEventSearch>().AutoMap();

        type.Delegate(x => x.Regions).GetValue(GetRegions);
        type.Delegate(x => x.Municipalities).GetValue(GetMunicipalities);

        return loader;
    }

    private IEnumerable<IMunicipality> GetMunicipalities(SitecoreDataMappingContext arg)
    {
        var municipalities = new List<IMunicipality>();
        foreach (IRegion region in GetRegions(arg))
        {
            region.Municipalities.ForEach(municipalities.Add);
        }
        return municipalities.OrderBy(x => x.Title, StringComparer.CurrentCultureIgnoreCase);
    }

    private IEnumerable<IRegion> GetRegions(SitecoreDataMappingContext arg)
    {
        var context = new Context();
        return from region in context.EventSearchPage.Children
            select arg.Service.Cast<IRegion>(region);
    }
}

person Thomas Therkildsen    schedule 18.03.2015    source источник
comment
Не могли бы вы сказать мне, какую версию Glass.Mapper.Sc.CastleWindsor вы используете? Последняя версия 3.3.0.25.   -  person Michael Edwards    schedule 18.03.2015


Ответы (1)


Ваш комментарий Михаил, направьте меня на правильный путь.

Решением было обновить Glass.Mapper.Sc.CastleWindsor до версии 3.3.0.25. Я был на 3.2.1.23.

Однако я ранее пытался:

PM> Update-Package Glass.Mapper.Sc.CastleWindsor
No updates available for 'Glass.Mapper.Sc.CastleWindsor' in project 'Core'.

Но, как вы можете видеть, он сказал: «Нет доступных обновлений».

Решение было:

Install-Package Glass.Mapper.Sc.CastleWindsor -version 3.3.0.25
person Thomas Therkildsen    schedule 18.03.2015