本文整理汇总了C#中Mapper.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Mapper.Add方法的具体用法?C# Mapper.Add怎么用?C# Mapper.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapper
的用法示例。
在下文中一共展示了Mapper.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanOnlyMapCorrespondingTypes
public void CanOnlyMapCorrespondingTypes()
{
var blob = new Parts("o/r1", TreeEntryTargetType.Blob, "b1", "a");
var tree = new Parts("o/r1", TreeEntryTargetType.Tree, "b1", "c");
var m = new Mapper();
Assert.Throws<ArgumentException>(() => m.Add(blob, tree));
Assert.Throws<ArgumentException>(() => m.Add(tree, blob));
}
示例2: CreateMapTest
public void CreateMapTest()
{
Mapper mapper = new Mapper();
StringCollection propertyList = mapper.GetPaymentProperties();
mapper.Add("ClaimID", propertyList[0]);
mapper.Add("Fee", propertyList[1]);
mapper.Add("UID", propertyList[2]);
mapper.Add("InsurerContractCode", propertyList[11]);
//StringDictionary dict = mapper.GetCurrentMap();
Assert.That(mapper.Count == 4);
Assert.IsTrue(mapper.ContainsKey("Fee"));
Assert.IsTrue(mapper["Fee"] == "Amount");
}
示例3: GetMapper
public Mapper GetMapper(List<SyncItem> syncItems)
{
var mapper = new Mapper();
foreach (var syncItem in syncItems)
{
var toPart = new Parts("Particular/" + Name, syncItem.Parts.Type, Branch, ApplyTargetPathTemplate(syncItem));
mapper.Add(syncItem.Parts, toPart);
}
return mapper;
}