本文整理汇总了C#中IPropertyBag.Merge方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertyBag.Merge方法的具体用法?C# IPropertyBag.Merge怎么用?C# IPropertyBag.Merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyBag
的用法示例。
在下文中一共展示了IPropertyBag.Merge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetProperties
/// <summary>
/// Sets the properties.
/// </summary>
/// <param name="context"></param>
/// <param name="dataspace"></param>
/// <param name="attributes"></param>
private void SetProperties(IMansionContext context, IPropertyBag dataspace, IEnumerable<KeyValuePair<string, object>> attributes)
{
// copy the attributes
dataspace.Merge(attributes);
// execute children
ExecuteChildTags(context);
}
示例2: DoMap
/// <summary>
/// Maps the given <paramref name="dbRecord"/> to <paramref name="properties"/>.
/// </summary>
/// <param name="context">The <see cref="IMansionContext"/>.</param>
/// <param name="dbRecord">The <see cref="DbRecord"/> which to map.</param>
/// <param name="properties">The <see cref="IPropertyBag"/> in which to store the mapped result.</param>
protected override void DoMap(IMansionContext context, DbRecord dbRecord, IPropertyBag properties)
{
// get the index of the column
var extendedPropertiesIndex = dbRecord.GetOrdinal("extendedProperties");
// check if there are no extended properties
if (dbRecord.IsDBNull(extendedPropertiesIndex))
return;
// get the extended properties
var extendedPropertiesLength = dbRecord.GetBytes(extendedPropertiesIndex, 0, null, 0, 0);
var serializedProperties = new byte[extendedPropertiesLength];
dbRecord.GetBytes(extendedPropertiesIndex, 0, serializedProperties, 0, serializedProperties.Length);
// deserialize
var deserializedProperties = conversionService.Convert<IPropertyBag>(context, serializedProperties);
// merge the deserialized properties
properties.Merge(deserializedProperties);
}