60 lines
1.6 KiB
Plaintext
60 lines
1.6 KiB
Plaintext
<?xml version="1.0" encoding="utf-8"?>
|
||
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
|
||
<CodeSnippet Format="1.0.0">
|
||
<Header>
|
||
<Title>bigdatacache</Title>
|
||
<Shortcut>bigdatacache</Shortcut>
|
||
<Description>类的代码片段包含数据库访问</Description>
|
||
<Author>zz</Author>
|
||
<SnippetTypes>
|
||
<SnippetType>Expansion</SnippetType>
|
||
<SnippetType>SurroundsWith</SnippetType>
|
||
</SnippetTypes>
|
||
</Header>
|
||
<Snippet>
|
||
<Declarations>
|
||
<Literal>
|
||
<ID>name</ID>
|
||
<ToolTip>字段名</ToolTip>
|
||
<Default>T_APP_CONFIGS</Default>
|
||
</Literal>
|
||
<Literal>
|
||
<ID>daoclass</ID>
|
||
<ToolTip>类名</ToolTip>
|
||
<Default>T_App_Config</Default>
|
||
</Literal>
|
||
</Declarations>
|
||
<Code Language="csharp"><![CDATA[
|
||
/// <summary>
|
||
/// 缓存数据
|
||
/// </summary>
|
||
private static List<$daoclass$> _$name$ = null;
|
||
/// <summary>
|
||
/// 锁
|
||
/// </summary>
|
||
private static object _$name$_LOCK = new object();
|
||
/// <summary>
|
||
/// app配置数据,引用类型,不可修改,只能查询使用
|
||
/// </summary>
|
||
public static List<$daoclass$> $name$LIST
|
||
{
|
||
get
|
||
{
|
||
if (_$name$ == null)
|
||
{
|
||
lock (_$name$_LOCK)
|
||
{
|
||
var dao = new DAO();
|
||
_$name$ = dao.daoRes.context.$daoclass$.ToList();
|
||
}
|
||
}
|
||
return _$name$;
|
||
}
|
||
}
|
||
$selected$$end$
|
||
]]>
|
||
</Code>
|
||
</Snippet>
|
||
</CodeSnippet>
|
||
</CodeSnippets>
|