Virtual Property C# Code Snippet

For those of you who use NHibernate you may find this convenient, if you don’t already have your own.  Below is a C# code snippet for creating a public virtual property (code and file are both there).  Just put it in your <Visual Studio 2005/2008>\Code Snippets\Visual C#\My Code Snippets folder and you’re off and running.  No restart required.



<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="">
    <CodeSnippet Format="1.0.0">
            <Description>Code snippet for an automatically implemented virtual property</Description>
            <Author>Microsoft Corporation</Author>
                    <ToolTip>Property type</ToolTip>
                    <ToolTip>Property name</ToolTip>
            <Code Language="csharp"><![CDATA[public virtual $type$ $property$ { get; set; }$end$]]>