本文整理汇总了C#中Record.ClearFromCache方法的典型用法代码示例。如果您正苦于以下问题:C# Record.ClearFromCache方法的具体用法?C# Record.ClearFromCache怎么用?C# Record.ClearFromCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record.ClearFromCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoDelete
/// <summary>
/// Deletes an existing <paramref name="record"/> from this repository.
/// </summary>
/// <param name="context">The <see cref="IMansionContext"/>.</param>
/// <param name="record">The <see cref="Record"/> which will be deleted.</param>
protected override void DoDelete(IMansionContext context, Record record)
{
// execute in the decorated repository
DecoratedRepository.Delete(context, record);
// clear the cache for the given record
record.ClearFromCache(context, cachingService);
}
示例2: DoUpdate
/// <summary>
/// Updates an existing <paramref name="record"/> in this repository.
/// </summary>
/// <param name="context">The <see cref="IMansionContext"/>.</param>
/// <param name="record">The <see cref="Record"/> which will be updated.</param>
/// <param name="properties">The updated properties.</param>
protected override void DoUpdate(IMansionContext context, Record record, IPropertyBag properties)
{
// execute in the decorated repository
DecoratedRepository.Update(context, record, properties);
// clear the cache for the given record
record.ClearFromCache(context, cachingService);
}