예제 #1
0
        /// <summary>
        /// Checks the arguments for a return type and reassigns it. Once a return type is found, this doesn't do anything.
        /// </summary>
        public void CheckArgumentsForReturnType()
        {
            if (!string.IsNullOrEmpty(_returnType))
            {
                return;
            }
            //look thru Arguments for a nameless out argument- that's the return type
            DatabaseArgument returnArgument = null;

            foreach (var argument in Arguments)
            {
                if ((argument.Out && string.IsNullOrEmpty(argument.Name)) ||
                    //MySql parameters may be marked "IN" so we look for ordinal and name
                    (argument.Name.Equals("RETURN_VALUE", StringComparison.OrdinalIgnoreCase) &&
                     argument.Ordinal == 0))
                {
                    returnArgument = argument;
                    break;
                }
            }
            //couldn't find one
            if (returnArgument == null)
            {
                return;
            }

            _returnType = returnArgument.DatabaseDataType;
            Arguments.Remove(returnArgument);
        }
예제 #2
0
파일: DataType.cs 프로젝트: thinhils/Nikita
        /// <summary>
        /// Gets the name of the C# net data type, correcting for the argument properties
        /// </summary>
        /// <param name="argument">The argument.</param>
        /// <returns></returns>
        public string NetCodeName(DatabaseArgument argument)
        {
            if (!IsNumeric || IsInt)
            {
                return(NetDataTypeCSharpName);
            }
            var precision = argument.Precision.GetValueOrDefault();
            var scale     = argument.Scale.GetValueOrDefault();

            return(NetNameForIntegers(scale, precision));
        }