CodeSmith Community
Your Code. Your Way. Faster!

Custom Method (from SP when using output params) FIX

Latest post 06-21-2007 3:22 PM by swin. 1 replies.
  • 06-21-2007 9:30 AM

    • acecebov
    • Not Ranked
    • Joined on 05-18-2007
    • Skopje, Macedonia
    • Posts 2
    • Points 70

    Custom Method (from SP when using output params) FIX

     Hi

    I found a bug in .netTiers v2.0.1.471 when generating custom methods from a store procedure that is using output params.

     

    This bug is that in the \DataAccessLayer.SqlClient\SqlEntityProviderBase.generated.cst file in the CUSTOM METHODS section where the outputValues string is building:

    <%           
                //Set up the output params
                StringBuilder outputValues = new StringBuilder();

                foreach(ParameterSchema outParam in command.AllOutputParameters)
                {
                    outputValues.AppendFormat("\t\t\t{0} =  Utility.GetParameterValue<{1}>(commandWrapper.Parameters[\"{2}\"]);\n",GetPrivateName(outParam), GetCSType(outParam), outParam);
                }
                %>

     

    and it should be

    <%           
                //Set up the output params
                StringBuilder outputValues = new StringBuilder();

                foreach(ParameterSchema outParam in command.AllOutputParameters)
                {
                    outputValues.AppendFormat("\t\t\t{0} =  Utility.GetParameterValue<{1}>(commandWrapper.Parameters[\"{2}\"]);\n",GetPrivateName(outParam), GetCSType(outParam), outParam.Name);
                }
                %>

    because it retrieves values from the  commandWrapper.Parameters["dbo.SP_NAME.@OutputParam"] and should be ommandWrapper.Parameters["@OutputParam"].


    • Post Points: 35
  • 06-21-2007 3:22 PM In reply to

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 922
    • Points 34,710

    Re: Custom Method (from SP when using output params) FIX

    Thanks for the report, and you'll be pleased to know this has already been fixed in a later version.

    swin

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