CodeSmith Community
Your Code. Your Way. Faster!

Possibility to prefix custom stored procedure in code

Latest post 08-07-2007 5:12 AM by bmmin. 0 replies.
  • 08-07-2007 5:12 AM

    • bmmin
    • Not Ranked
    • Joined on 08-07-2007
    • Posts 2
    • Points 10

    Possibility to prefix custom stored procedure in code

    If you have a table customer, and a stored procedure customer_getAll that you want to keep (lets say it gets all customers that are active) next to the generated getAll, but you also want to access it from your code, you will get compilation errors saying that getAll is defined multiple times.

    To circumvent, I added  in CommonSqlCode.cs:
    added custAddPrefixForStoredProcedure for interoperability of stored procedures
    line 54:         private string custAddPrefixForStoredProcedure = "StrdProc_";
    line 4481 (func GetCustomProcedures) :

                            if ( proc.Name.ToLower().StartsWith(customPrefix.ToLower()) )
                            {
                                customName = custAddPrefixForStoredProcedure + proc.Name.Substring(customPrefix.Length);
                                procs.Add(customName, proc);
                            }
     

    If you think it is a useful feature, it might be added to the 09. Code style - Advanced setting, and taken from there. I think its a good idea.

    • Post Points: 5
Page 1 of 1 (1 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems