方法 LoadFromSource
LoadFromSource(字符串)
负责从数据源加载对象。 键作为参数传递。
声明
ProviderCacheItem LoadFromSource(string key)
参数
Type | 名字 | 课程描述 |
---|---|---|
系统字符串 | 键 | 用于引用对象的键。 |
退货政策
Type | 课程描述 |
---|---|
Provider缓存项 | 具有一些有限字段的 CacheItem。 |
国际私人包机价格项目范例
以下示例对数据源执行单个操作。
public ProviderCacheItem LoadFromSource(string key)
{
return new ProviderCacheItem(_source.LoadCustomer(key));
}
LoadFromSource(ICollection )
负责从数据源加载对象数组。键作为参数传递。
声明
IDictionary<string, ProviderCacheItem> LoadFromSource(ICollection<string> keys)
参数
Type | 名字 | 课程描述 |
---|---|---|
系统.集合.通用.ICollection<系统字符串> | 键 | 键数组。 |
退货政策
Type | 课程描述 |
---|---|
System.Collections.Generic.IDictionary<系统字符串, Provider缓存项> |
国际私人包机价格项目范例
以下示例对数据源执行多个操作。
public IDictionary<string, ProviderCacheItem> LoadFromSource(ICollection<string> keys)
{
Dictionary<string, ProviderCacheItem> dictionary = new Dictionary<string, ProviderCacheItem>();
foreach (string key in keys)
{
ProviderCacheItem item = LoadFromSource(key);
dictionary.Add(key, item);
}
return dictionary;
}