<%@ CodeTemplate Src="TemplateLib/CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Language="C#" TargetLanguage="Text" Description="NetTiers main template." Debug="True" ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%> <%@ Assembly Name="SchemaExplorer" %> <%@ Assembly Name="System.Design" %> <%@ Assembly Name="System.DirectoryServices" %> <%@ Assembly Name="System.Web" %> <%@ Assembly Name="System.Xml" %> <%@ Import Namespace="SchemaExplorer" %> <%@ Import NameSpace="System.IO" %> <%@ Import NameSpace="System.Text" %> <%@ Import NameSpace="System.Text.RegularExpressions" %> <%@ Import NameSpace="System.Diagnostics" %> <%@ Import NameSpace="System.Xml" %> <%@ Import NameSpace="System.Xml.Xsl" %> <%@ Import NameSpace="System.Xml.XPath" %> <%-- 1. Datasource --%> <%@ Property Name="ChooseSourceDatabase" Type="SchemaExplorer.DatabaseSchema" DeepLoad="True" Optional="False" Category="01. Getting Started - Required" Description="Database that the tables views, and stored procedures should be based on. IMPORTANT!!! If SourceTables and SourceViews are left blank, the Entire Database will then be generated." %> <%-- 2. Framework Generation Category --%> <%@ Property Name="ExecuteSql" Type="System.Boolean" Default="False" Category="02. Framework Generation - Optional" Description="If true the stored procedures are installed on the sql server. (The SQL file is generated in all case)" %> <%@ Property Name="SQLFolderName" Type="System.String" Category="02. Framework Generation - Optional" Description="The sub folder to output the SQL scripts" Default="SQL" Optional="False"%> <%@ Property Name="ViewReport" Type="System.Boolean" Default="True" Category="02. Framework Generation - Optional" Description="Indicates if the html report should launched at the end of the generation." %> <%@ Property Name="AutoIncrementBuildVersion" Type="System.Boolean" Default="True" Category="02. Framework Generation - Optional" Description="Indicates if assembley build version should be auto incremented." %> <%@ Property Name="LaunchVisualStudio" Type="System.Boolean" Default="False" Category="02. Framework Generation - Optional" Description="Attempts to launch visual studio with the generated solution only if there are no instances already open." %> <%@ Property Name="IncludeUnitTest" Type="MoM.Templates.UnitTestStyle" Default="None" Category="02. Framework Generation - Optional" Description="Indicates type of Unit tests to be generated." %> <%@ Property Name="IncludeComponentLayer" Type="MoM.Templates.ComponentPatternType" Category="02. Framework Generation - Optional" Description="The pattern type to implement in the Component Layer." Default="None" %> <%@ Property Name="IncludeWCFDataAttributes" Type="System.Boolean" Default="False" Category="02. Framework Generation - Optional" Description="Indicates if the WCF attributes, [DataContract] and [DataMember], should be included on the entity classes." %> <%@ Property Name="SerializeEntityState" Type="System.Boolean" Default="False" Category="02. Framework Generation - Optional" Description="Indicates if the EntityState property should be included during serialization. Useful if needing to know what state the entity is in over webservices." %> <%@ Property Name="EntLibVersion" Type="MoM.Templates.EntLibVersion" Default="v4_1" Category="02. Framework Generation - Optional" Description="Indicates the Enterprise Library version to use. Options include v2, v3, v3.1, v4 and v4.1" %> <%@ Property Name="VisualStudioVersion" Type="MoM.Templates.VSNetVersion" Default="v2008" Category="02. Framework Generation - Optional" Description="Indicates the Version of Visual Studio to target. Options include v2005 and v2008" %> <%@ Property Name="DotNetVersion" Type="MoM.Templates.DotNetFrameworkVersion" Default="v3_5" Category="02. Framework Generation - Optional" Description="Indicates the Version of Dot Net to target. Options include v2, v3 and v3.5" %> <%@ Property Name="IncludeXmlAttributes" Type="System.Boolean" Default="False" Category="02. Framework Generation - Optional" Description="Indicates if the Xml attributes, [XmlElement(IsNullable=true)], should be included on the entity classes." %> <%@ Property Name="CustomCodeFolderName" Type="System.String" Category="02. Framework Generation - Optional" Description="If specified, indicates the name of a folder that can contains custom classes to dynamically add to each project." Default="App_Code" %> <%@ Property Name="EqualitySemantics" Type="MoM.Templates.EqualitySemantics" Default="Value" Category="02. Framework Generation - Optional" Description="Equality semantics used for Entity instances. If 'Reference', default reference type semantics will be used (based on object identity). If 'Value', Equals() and GetHashCode() will be overridden to use value semantics (based on object contents)." %> <%@ Property Name="TimeStandard" Type="TimeStandardEnum" Default="Local" Category="02. Framework Generation - Optional" Description="Standard used for generating DateTime values. If 'UTC' DateTime is generated based on UtcNow. If 'Local' DateTime is generated based on DateTime.Now" %> <%@ Property Name="IsConnectionStringAzure" Type="System.Boolean" Default="False" Category="02. Framework Generation - Optional" Description="Indicates if at runtime the netTiersConnectionString is read from Window Azure's ServiceConfiguration.cscfg or from Web.config/app.config." %> <%-- 3. Namespaces Category --%> <%@ Property Name="BusinessLogicLayerNameSpace" Type="System.String" Category="03. Namespaces - Required" Description="The sub namespace that is added to the root namespace for the entities." Default="Entities" Optional="False" %> <%@ Property Name="DataAccessLayerNameSpace" Type="System.String" Category="03. Namespaces - Required" Description="The sub namespace for the Data access layer components classes." Default="Data" Optional="False"%> <%@ Property Name="UnitTestsNameSpace" Type="System.String" Category="03. Namespaces - Required" Description="The sub namespace for the UnitTests classes." Default="UnitTests" %> <%-- End Required, The Rest Optional --%> <%-- General Category --%> <%@ Property Name="CompanyName" Optional="True" Type="System.String" Category="04. General - Advanced" Description="The name of your company. This is only for documenation." %> <%@ Property Name="CompanyURL" Optional="True" Type="System.String" Category="04. General - Advanced" Description="The URL of your company. This is only for documenation." %> <%@ Property Name="SignAssembly" Type="System.Boolean" Category="04. General - Advanced" Description="If true, projects will try to sign the assemblies and search for the snk in the local directory." Default="false" %> <%-- 5.0 Web Library --%> <%@ Property Name="GenerateWebLibrary" Type="System.Boolean" Default="true" Category="05. WebLibrary - Advanced" Description="Indicates if the web library should be generated. This contains the EntityDataSource and Other Helpful ASP.net utility classes." %> <%@ Property Name="IncludeDesignTimeSupport" Type="System.Boolean" Default="true" Category="05. WebLibrary - Advanced" Description="Indicates if Visual Studio design-time support should be provided for the Web Library controls." %> <%@ Property Name="DataSourceEnableTransactionDefault" Type="System.Boolean" Default="true" Category="05. WebLibrary - Advanced" Description="Sets the default for the EnableTransaction property on the data source controls." %> <%-- 6.0 ASP.Net Admin Controls --%> <%-- 6.0 webservice --%> <%@ Property Name="WebServiceClassName" Type="System.String" Optional="True" Default="" Category="06. Web - Advanced" Description="The class name of the Web Services. Defaults to Namespace + 'Services' if not specified." %> <%@ Property Name="GenerateWebservice" Type="System.Boolean" Default="false" Category="06. Web - Advanced" Description="Indicates if the webservice dataaccesslayer should be generated" %> <%@ Property Name="AttemptCreateLocalVirtualDirectory" Type="System.Boolean" Default="false" Category="06. Web - Advanced" Description="Indicates if you would like the generator to attempt to create the virtual directory for the url specified in WebServiceUrl if it doesn't exist for the WebserviceOutput directory." %> <%-- 6.5 ASP.Net Website --%> <%@ Property Name="GenerateWebsite" Type="System.Boolean" Default="true" Category="06b. Website - Advanced" Description="Indicates if a complete website should be generated." %> <%@ Property Name="UseWebAppProject" Type="System.Boolean" Default="false" Category="06b. Website - Advanced" Description="Indicates if a Web Application Project file should be generated. Note: you must have the Visual Studio extension installed in order to open the project." %> <%@ Property Name="OverwriteWebConfig" Type="System.Boolean" Default="false" Category="06b. Website - Advanced" Description="Indicates if the Web.config should be overwritten." %> <%@ Property Name="IncludeAtlasLibrary" Type="System.Boolean" Default="false" Category="06b. Website - Advanced" Description="Indicates whether to include a reference to the Atlas component library." %> <%@ Property Name="IncludeAtlasToolkit" Type="System.Boolean" Default="false" Category="06b. Website - Advanced" Description="Indicates whether to include a reference to the Atlas Control Toolkit. This property is only taken into account when IncludeAtlasLibrary is true." %> <%@ Property Name="GenerateWebsiteAdmin" Type="System.Boolean" Default="true" Category="06b. Website - Advanced" Description="Indicates if the web admin should be generated." %> <%@ Property Name="DateFormat" Type="System.String" Default="MM/dd/yyyy" Category="06b. Website - Advanced" Description="The format to be used when displaying dates in the web site." %> <%-- 7.0 Retry of SQL statements --%> <%@ Property Name="RetryEnabled" Optional="False" Type="System.Boolean" Category="07. CRUD - Advanced" Default="false" Description="Enabling Retry will add code retry the queries that failed with data exceptions. Useful to if your database becomes temporarily unavailable." %> <%@ Property Name="RetryMaxAttempts" Optional="True" Type="System.Int32" Category="07. CRUD - Advanced" Description="The number of attempts that will be made." Default="5" %> <%@ Property Name="RetrySleepTime" Optional="True" Type="System.Int32" Category="07. CRUD - Advanced" Description="The number of milliseconds that the current thread will sleep between attempts. Sleep only occurs if an exception is thrown." Default="1000" %> <%@ Property Name="RetrySleepStyle" Optional="True" Type="MoM.Templates.SleepStyle" Category="07. CRUD - Advanced" Description="" %> <%-- 7.0 CRUD Options --%> <%@ Property Name="LibraryPath" Type="System.String" Default="References" Category="07. CRUD - Advanced" Description="Path of the assembly library directory from the project output directory root." %> <%@ Property Name="IncludeCustoms" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true custom stored procedures (that starts with '_TableName_') will be detected and generated." %> <%@ Property Name="CustomNonMatchingReturnType" Type="CustomNonMatchingReturnType" Default="DataSet" Category="07. CRUD - Advanced" Description="When using custom stored procedures, if the returned rows do not match the fields in an entity, a DataSet or IDataReader will be returned. Choose One. This is useful if you've returned more than one resultset in a custom procedure; you can use a ConvertToDataSet(IDataReader) method in the Utility class to convert that to a DataSet." %> <%@ Property Name="IncludeDrop" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If True then drop statements will be generated in accordance with the DropStyle. If False then no procedures will be droppped" %> <%@ Property Name="DropStyle" Type="DropStyleEnum" Default="Entity" Category="07. CRUD - Advanced" Description="If Entity then drop statements will be generated to drop existing stored procedures for procedures being generated. If All then all existing netTiers procedures that match the ProcedurePrefix (one must be specified) and do not match the CustomProceduresStartsWith will be droppped." %> <%@ Property Name="IncludeInsert" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true insert procedures will be generated." %> <%@ Property Name="IncludeUpdate" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true update procedures will be generated." %> <%@ Property Name="IncludeSave" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true combined insert/update/delete procedures will be generated. In consequence, if this option is selected IncludeInsert, IncludeUpdate and IncludeDelete are automatically activated." %> <%@ Property Name="IncludeDelete" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true delete procedures will be generated." %> <%@ Property Name="IncludeGet" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true get procedures will be generated." %> <%@ Property Name="IncludeGetList" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true getlist procedures will be generated." %> <%@ Property Name="IncludeGetListByFK" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true get statements will be generated." %> <%@ Property Name="IncludeGetListByIX" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true getlist statements will be generated." %> <%@ Property Name="IncludeFind" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true find statements will be generated." %> <%@ Property Name="IncludeManyToMany" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true select statements will be generated for any many to many relationship." %> <%@ Property Name="IncludeRelations" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If true select statements will be generated for any many to many relationship." %> <%@ Property Name="IsolationLevel" Type="TransactionIsolationLevelEnum" Default="None" Category="07. CRUD - Advanced" Description="Isolation level to use in generated procedures." %> <%@ Property Name="UseTimestampConcurrency" Type="System.Boolean" Default="True" Category="07. CRUD - Advanced" Description="If this is set to True, Update and Delete will throw DbConcurrencyException when the timestamp doesn't match current." %> <%-- Style of stored procedures --%> <%@ Property Name="InsertSuffix" Type="System.String" Default="_Insert" Category="08. Stored procedures - Advanced" Description="Suffix to use for all generated INSERT stored procedures." %> <%@ Property Name="UpdateSuffix" Type="System.String" Default="_Update" Category="08. Stored procedures - Advanced" Description="Suffix to use for all generated UPDATE stored procedures." %> <%@ Property Name="DeleteSuffix" Type="System.String" Default="_Delete" Category="08. Stored procedures - Advanced" Description="Suffix to use for all generated DELETE stored procedures." %> <%@ Property Name="SelectSuffix" Type="System.String" Default="_Get" Category="08. Stored procedures - Advanced" Description="Suffix to use for all generated SELECT stored procedures." %> <%@ Property Name="SelectAllSuffix" Type="System.String" Default="_List" Category="08. Stored procedures - Advanced" Description="Suffix to use for all generated SELECT stored procedures." %> <%@ Property Name="FindSuffix" Type="System.String" Default="_Find" Category="08. Stored procedures - Advanced"Description="Suffix to use for all generated selective SELECT stored procedures." %> <%@ Property Name="GrantReadUser" Type="System.String" Category="08. Stored procedures - Advanced" Description="Optional user or role to GRANT EXEC Procedure permissions to (for all generated read only procedures)" Default="" Optional="True" %> <%@ Property Name="GrantUser" Type="System.String" Category="08. Stored procedures - Advanced" Description="Optional user or role to GRANT EXEC Procedure permissions to (for all generated procedures)" Default="" Optional="True" %> <%-- 9.0 windows forms Library --%> <%@ Property Name="GenerateWinLibrary" Type="System.Boolean" Default="false" Category="09. Winforms Library - Advanced" Description="Indicates if the WindowsForms library should be generated. This contains grids and edit controls for each entity generated." %> <%-- Register Templates in framework --%> <%-- Register User Templates --%> <% Verbose = false; // change this to true if you want verbose output in this template this.Go(); %>