本文整理汇总了C#中IEntityPersister.GetMappedClass方法的典型用法代码示例。如果您正苦于以下问题:C# IEntityPersister.GetMappedClass方法的具体用法?C# IEntityPersister.GetMappedClass怎么用?C# IEntityPersister.GetMappedClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEntityPersister
的用法示例。
在下文中一共展示了IEntityPersister.GetMappedClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPropertyValues
private object[] GetPropertyValues(IEntityPersister persister, ICriteria criteria, ICriteriaQuery criteriaQuery)
{
System.Type type = _entity.GetType();
if(type == persister.GetMappedClass(GetEntityMode(criteria, criteriaQuery))) //not using anon object
{
return persister.GetPropertyValues(_entity, GetEntityMode(criteria, criteriaQuery));
}
ArrayList list = new ArrayList();
for(int i = 0; i < persister.PropertyNames.Length; i++)
{
PropertyInfo pInfo = type.GetProperty(persister.PropertyNames[i]);
if(pInfo != null)
{
list.Add(pInfo.GetValue(_entity, null));
}
else
{
list.Add(null); //to maintain same order as PropertyNames list
_excludedProperties.Add(persister.PropertyNames[i]); //exclude the properties that aren't in the anon object (duplicates ok)
}
}
return list.ToArray();
}
示例2: MarkInterceptorDirty
private void MarkInterceptorDirty(object entity, IEntityPersister persister, IEventSource source)
{
if (FieldInterceptionHelper.IsInstrumented(entity))
{
IFieldInterceptor interceptor = FieldInterceptionHelper.InjectFieldInterceptor(entity, persister.EntityName, persister.GetMappedClass(source.EntityMode), null, null, source);
interceptor.MarkDirty();
}
}