Skip to content
Snippets Groups Projects
Commit ba8b94ac authored by areynold's avatar areynold
Browse files

Add EF query logging snippets

parent 0aeda36b
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,10 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="Snippets\CSharp\Beckman\entityframeworklog.snippet" />
<None Include="Snippets\CSharp\Beckman\entityframeworklogconstructor.snippet">
<SubType>Designer</SubType>
</None>
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
......
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Entity Framework Query Logging</Title>
<Shortcut>eflog</Shortcut>
<Description>Add to DataContext constructor to log Entity Framework queries to Output pane.</Description>
<Author>Andrew Reynolds</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<HelpUrl>http://sietch.net/ViewNewsItem.aspx?NewsItemID=254</HelpUrl>
<Keywords>
<Keyword>entity framework</Keyword>
<Keyword>logging</Keyword>
</Keywords>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[
#if DEBUG
this.Database.Log = s => System.Diagnostics.Debug.WriteLine(s);
#endif
$end$
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Entity Framework Query Logging Constructor</Title>
<Shortcut>eflogctor</Shortcut>
<Description>Creates DataContext constructor to log Entity Framework queries to Output pane.</Description>
<Author>Andrew Reynolds</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<HelpUrl>http://sietch.net/ViewNewsItem.aspx?NewsItemID=254</HelpUrl>
<Keywords>
<Keyword>entity framework</Keyword>
<Keyword>logging</Keyword>
</Keywords>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>classname</ID>
<ToolTip>Class name.</ToolTip>
<Function>ClassName()</Function>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[
public $classname$()
{
#if DEBUG
this.Database.Log = s => System.Diagnostics.Debug.WriteLine(s);
#endif
}$end$
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Beckman.Snippets.Andrew Reynolds.554a17d5-acf8-469c-ad75-060f99bab879" Version="1.0.0" Language="en-US" Publisher="Andrew Reynolds" />
<Identity Id="Beckman.Snippets.Andrew Reynolds.554a17d5-acf8-469c-ad75-060f99bab879" Version="1.1.0" Language="en-US" Publisher="Andrew Reynolds" />
<DisplayName>Beckman Snippets</DisplayName>
<Description xml:space="preserve">Visual Studio code snippets commonly used in Beckman projects.</Description>
<MoreInfo>http://madskristensen.net/post/shipping-visual-studio-snippets-in-an-extension</MoreInfo>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment