本文整理汇总了C#中MappingSchema.GetObjectMapper方法的典型用法代码示例。如果您正苦于以下问题:C# MappingSchema.GetObjectMapper方法的具体用法?C# MappingSchema.GetObjectMapper怎么用?C# MappingSchema.GetObjectMapper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MappingSchema
的用法示例。
在下文中一共展示了MappingSchema.GetObjectMapper方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnsureMapper
public override void EnsureMapper(TypeAccessor typeAccessor, MappingSchema mappingSchema, EnsureMapperHandler handler)
{
foreach (MapFieldAttribute attr in GetMapFieldAttributes(typeAccessor))
{
if (attr.OrigName != null)
handler(attr.MapName, attr.OrigName);
else
{
var ma = typeAccessor[attr.MapName];
foreach (MemberMapper inner in mappingSchema.GetObjectMapper(ma.Type))
handler(string.Format(attr.Format, inner.Name), ma.Name + "." + inner.MemberName);
}
}
}
示例2: TextDataWriter
public TextDataWriter(Stream stream, MappingSchema mappingSchema, Type type)
: this(stream, mappingSchema, mappingSchema.GetObjectMapper(type).FieldNames)
{
}
示例3: GetIndex
public IDictionary<object,IList> GetIndex(MappingSchema ms, MapIndex masterIndex)
{
var indexId = masterIndex.ID;
IDictionary<object,IList> indexHash;
if (_indexies.TryGetValue(indexId, out indexHash))
return indexHash;
var masterMapper = ms.GetObjectMapper(ObjectType);
indexHash = new Dictionary<object, IList>();
foreach (var o in List)
{
var key = masterIndex.GetValueOrIndex(masterMapper, o);
if (ms.IsNull(key))
continue;
IList matches;
if (!indexHash.TryGetValue(key, out matches))
indexHash.Add(key, matches = new List<object>());
matches.Add(o);
}
return indexHash;
}