---
title: "カスタム値マッピングセット用のコンバーターを実装します"
slug: "implement-a-converter-for-a-custom-value-mapping-set"
abstract: "Sitecoreのカスタム値マッピングセットタイプを作成するためのコンバーターの実装方法。"
---
# カスタム値マッピングセット用のコンバーターを実装します

Data Exchange Frameworkでは、Sitecoreのアイテムは設定のみに使用されます。データ同期プロセスが実行されると、Sitecoreのアイテムから設定が読み取られ、その後フレームワークコンポーネントに変換されます。

## テンプレートのアイテムIDを取得してください

コンバーターをカスタム値マッピングセットのテンプレートにリンクするには、テンプレートのアイテムIDを見つけてコピーする必要があります。

これを行うには:

1.  コンテンツエディターで */sitecore/templates/Data Exchange/Framework/Data Access/Mapping/Custom Value Mapping Set*へ移動します。
    
2.  **「コンテンツ**」タブをクリックしてください。
    
3.  **クイックインフォ**のセクションで*Item ID*値をコピーしてください。
    
    ![Quick Info section on the Content tab, showing the Item ID value.](https://doc.sitecore.com/api/markdown-image/xp/ja/developers/def/60/data-exchange-framework/images/quick-info-section.png)
    

## カスタムコンバータークラスを実装してください

カスタム値マッピングセットを表すSitecoreアイテムを、カスタム値マッピングセットタイプのインスタンスに変換するにはカスタムコンバーターが必要です。

クラスを実装するために:

-   Visual Studioで、次のクラスを追加します:
    
    using Sitecore.DataExchange;
    using Sitecore.DataExchange.Attributes;
    using Sitecore.DataExchange.Converters;
    using Sitecore.DataExchange.Repositories;
    using Sitecore.Services.Core.Model;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace Examples.DataExchange
    {
     SupportedIds("{00000000-0000-0000-0000-000000000000}")
     public class CustomMappingSetConverter : BaseItemModelConverter<CustomMappingSet>
     {
     public CustomMappingSetConverter(IItemModelRepository repository) : base(repository)
     {
     }
     private static CustomMappingSet \_instance = new CustomMappingSet();
     protected override ConvertResult<CustomMappingSet> ConvertSupportedItem(ItemModel source)
     {
     return ConvertResult<CustomMappingSet>.PositiveResult(\_instance);
     }
     }
    }
    

> !注属性*SupportedIds*では、前のステップでコピーしたテンプレートアイテムID使ってください。

## カスタムコンポーネントの展開

コードをSitecoreサーバーにデプロイするには:

1.  Visual Studioプロジェクトを構築してください。
2.  Examples.DataExchange.dllファイルをSitecoreサーバーにコピーしてください。