CPE_learningsite
This repository has no backups
This repository's network speed is throttled to 100KB/sec
Upgrade your account to fix these warnings, or use backups.vc for automated backups
d90493cf2f1f435b060f3ae01600f05f801f24a8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
<#@ include file="OrmLite.Core.ttinclude" #> <# // Settings ConnectionStringName = ""; // Uses last connection string in config if not specified var SPNamespace = "StoredProcedures"; ClassPrefix = ""; ClassSuffix = ""; // Read schema var sps = LoadSPs(); // Generate output if (sps.Count>0) { #> <# if (string.IsNullOrEmpty(SPNamespace)) SPNamespace=ConnectionStringName; if (string.IsNullOrEmpty(SPNamespace)) SPNamespace="StoredProcedures"; #> using System; using System.Data.Common; using System.Data; using System.Collections.Generic; using ServiceStack.OrmLite; namespace <#=SPNamespace#> { public static class SPList { private static DbParameter CreateNewParameter(DbCommand dbCommand, string paramName, object paramValue, ParameterDirection paramDirection, DbType paramType) { DbParameter param = dbCommand.CreateParameter(); param.Direction = paramDirection; param.DbType = paramType; param.ParameterName = paramName; param.Value = paramValue; return param; } <#foreach(var sp in sps){#> public static OrmLiteSPStatement <#=sp.CleanName#>(this IDbConnection db<#foreach(var param in sp.Parameters){#>, <#=param.NullableSysType#> <#=Inflector.MakeInitialLowerCase(param.Name)#> = null<#}#>) { var dbCmd = (DbCommand)OrmLiteConfig.ExecFilter.CreateCommand(db).ToDbCommand(); dbCmd.CommandText = "<#=sp.Name#>"; dbCmd.CommandType = CommandType.StoredProcedure; <#if (sp.Parameters.Count > 0) { foreach(var param in sp.Parameters){#> dbCmd.Parameters.Add(CreateNewParameter(dbCmd,"<#=param.Name#>",<#=Inflector.MakeInitialLowerCase(param.Name)#>,ParameterDirection.Input,<#=param.DbType#>)); <#}#> <#}#> return new OrmLiteSPStatement(db, dbCmd); } <#}#> } } <# } #> |
Commits for CPE_learningsite/CPE/CPE.App/CPE.App.Api/OrmLite.SP.tt
Revision | Author | Commited | Message |
---|---|---|---|
4cd176 ... | v.shishlov | Fri 27 Aug, 2021 14:33:17 +0000 | initial commit |