本文整理汇总了C#中IMapDataSource类的典型用法代码示例。如果您正苦于以下问题:C# IMapDataSource类的具体用法?C# IMapDataSource怎么用?C# IMapDataSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMapDataSource类属于命名空间,在下文中一共展示了IMapDataSource类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MapInternal
protected override void MapInternal(Reflection.InitContext initContext, IMapDataSource source, object sourceObject, IMapDataDestination dest, object destObject, params object[] parameters)
{
FullObjectMapper mapper = (FullObjectMapper)initContext.ObjectMapper;
IDataReader dataReader = (IDataReader)sourceObject;
//int[] index = GetIndex(source, dest);
//IValueMapper[] mappers = GetValueMappers(source, dest, index);
//foreach (var valueMapper in mappers)
//{
//}
InitSchema(dataReader);
if (mapper.ColParent)
{
FillObject(mapper, dataReader, destObject);
while (dataReader.Read())
{
destObject = FillObject(destObject, mapper, dataReader);
}
}
else
FillObject(mapper, dataReader, destObject);
}
开发者ID:MajidSafari,项目名称:bltoolkit,代码行数:26,代码来源:FullMappingSchema.cs
示例2: GetValue
public object GetValue(IMapDataSource source, object obj, int index)
{
if (source == null)
throw new ArgumentNullException("source");
var value = Fields[index].ByName?
source.GetValue(obj, Fields[index].Name):
source.GetValue(obj, Fields[index].Index);
if (value == null)
{
var objectMapper = source as ObjectMapper;
if (objectMapper != null)
{
var mm = Fields[index].ByName?
objectMapper[Fields[index].Name]: objectMapper[Fields[index].Index];
if (mm == null)
throw new MappingException(string.Format(Resources.MapIndex_BadField,
objectMapper.TypeAccessor.OriginalType.Name, Fields[index]));
}
}
return value;
}
开发者ID:MajidSafari,项目名称:bltoolkit,代码行数:26,代码来源:MapIndex.cs
示例3: GetValue
public object GetValue(IMapDataSource source, object obj, int index)
{
object value = _fields[index].ByName ?
source.GetValue(obj, _fields[index].Name) : source.GetValue(obj, _fields[index].Index);
if (value == null)
{
ObjectMapper objectMapper = source as ObjectMapper;
if (objectMapper != null)
{
MemberMapper mm = _fields[index].ByName ?
objectMapper[_fields[index].Name] : objectMapper[_fields[index].Index];
if (mm == null)
throw new MappingException(string.Format("Type '{0}' does not contain field '{1}'.",
objectMapper.TypeAccessor.OriginalType.Name, Fields[index]));
}
}
return value;
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:22,代码来源:MapIndex.cs
示例4: Map
public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
{
if(source.IsNull(sourceObject, sourceIndex))
{
destination.SetDecimal(destinationObject, destinationIndex, 0);
}
else
{
destination.SetDecimal(destinationObject, destinationIndex, Convert.ToDecimal(source.GetByte(sourceObject, sourceIndex)));
}
}
开发者ID:Gremlin2,项目名称:bookscanner,代码行数:11,代码来源:TypeMapper.cs
示例5: Map
public void Map(
IMapDataSource source, object sourceObject, int sourceIndex,
IMapDataDestination dest, object destObject, int destIndex)
{
dest.SetValue(destObject, destIndex, source.GetValue(sourceObject, sourceIndex));
//object o = source.GetValue(sourceObject, sourceIndex);
//if (o == null) dest.SetNull (destObject, destIndex);
//else dest.SetValue(destObject, destIndex, o);
}
开发者ID:MajidSafari,项目名称:bltoolkit,代码行数:11,代码来源:ValueMapping.Declare.cs
示例6: SimpleSourceListMapper
public SimpleSourceListMapper(IMapDataSource mapper)
{
_mapper = mapper;
}
开发者ID:MajidSafari,项目名称:bltoolkit,代码行数:4,代码来源:SimpleSourceListMapper.cs
示例7: GetValueOrIndex
public object GetValueOrIndex(IMapDataSource source, object obj)
{
return Fields.Length == 1?
GetValue(source, obj, 0):
GetIndexValue(source, obj);
}
开发者ID:MajidSafari,项目名称:bltoolkit,代码行数:6,代码来源:MapIndex.cs
示例8: GetValueOrIndex
public object GetValueOrIndex(IMapDataSource source, object obj)
{
if (Fields.Length == 1)
return GetValue(source, obj, 0);
return GetIndexValue(source, obj);
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:7,代码来源:MapIndex.cs
示例9: GetIndexValue
public CompoundValue GetIndexValue(IMapDataSource source, object obj)
{
object[] values = new string[Fields.Length];
for (int i = 0; i < values.Length; i++)
values[i] = GetValue(source, obj, i);
return new CompoundValue(values);
}
开发者ID:epdumitru,项目名称:mysqlib,代码行数:9,代码来源:MapIndex.cs
示例10: Map
public abstract void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex);
开发者ID:Gremlin2,项目名称:bookscanner,代码行数:1,代码来源:DataMapper.cs
注:本文中的IMapDataSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论