本文整理汇总了C#中SessionBase.OpenSchema方法的典型用法代码示例。如果您正苦于以下问题:C# SessionBase.OpenSchema方法的具体用法?C# SessionBase.OpenSchema怎么用?C# SessionBase.OpenSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionBase
的用法示例。
在下文中一共展示了SessionBase.OpenSchema方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Persist
/// <summary>
/// Persists this object.
/// </summary>
/// <param name="place">The placement rules to follow when persisting this object</param>
/// <param name="session">The session managing this object</param>
/// <param name="persistRefs">If true, objects referenced from this object will also be persisted</param>
/// <param name="disableFlush">If true, disables possible flushing of updated pages while persisting this object; otherwise pasge flushing may occur</param>
/// <returns>The object id of the persistent object</returns>
public virtual UInt64 Persist(Placement place, SessionBase session, bool persistRefs = true, bool disableFlush = false, Queue<IOptimizedPersistable> toPersist = null)
{
return session.Persist(place, this, session.OpenSchema(false), place.MaxObjectsPerPage, disableFlush, toPersist);
}
示例2: ToStringDetails
/// <summary>
/// Object details as a string
/// </summary>
/// <param name="session">The session managing this object</param>
/// <param name="skipArrays">Indicates if string should contain detailed array data.</param>
///<returns>
/// A <see cref="string"/> containing all details of this object.
///</returns>
static public string ToStringDetails(this OptimizedPersistable pObj, SessionBase session, bool skipArrays = true)
{
Schema schema = session.OpenSchema(false);
if (pObj.WrappedObject == null)
return pObj.ToString() + pObj.ToStringDetails(schema, pObj.Shape, skipArrays);
else
{
Array array = pObj.WrappedObject as Array;
if (array != null)
return pObj.WrappedObject.ToString() + " (" + array.Length + ") " + Oid.AsString(pObj.Id) + pObj.ToStringDetails(schema, pObj.Shape, skipArrays);
else
return pObj.WrappedObject.ToString() + " " + Oid.AsString(pObj.Id) + pObj.ToStringDetails(schema, pObj.Shape, skipArrays);
}
}