Exemplo n.º 1
0
        private static StringBuilder GenerateSpHeader(StoredProcedureParmeters storedProcedureParmeters)
        {
            var queryHeader = new StringBuilder();

            queryHeader.Append("CREATE PROCEDURE " + storedProcedureParmeters.StoredProcedureName);

            if (storedProcedureParmeters.IncludePrimaryKey)
            {
                IncludePk(queryHeader);
            }

            if (storedProcedureParmeters.IncludeAllParameters)
            {
                IncludeAllParameters(queryHeader);
            }

            if (storedProcedureParmeters.Parameters.Length > 0)
            {
                IncludeCustomParameters(storedProcedureParmeters, queryHeader);
            }

            queryHeader.Length--;
            queryHeader.Append(" AS ");

            return(queryHeader);
        }
Exemplo n.º 2
0
 private static void IncludeCustomParameters(StoredProcedureParmeters storedProcedureParmeters,
                                             StringBuilder queryHeader)
 {
     foreach (var parameter in storedProcedureParmeters.Parameters)
     {
         queryHeader.AppendFormat(" @{0} {1},", parameter,
                                  MapType(_tableInformation.Properties[parameter]));
     }
 }