public static string GenerateProceduceParametersMethodList(IProcedure procedure, bool isAllowNullable) { StringBuilder sbMethodList = new StringBuilder(); int count = 0; foreach (IParameter parameter in procedure.Parameters) { switch (parameter.Direction) { case ParamDirection.ReturnValue: break; case ParamDirection.Output: count++; if(count>1) { sbMethodList.Append(","); } sbMethodList.Append(ProceduceParameterGenerationHelper.GenerateMethodByParameter(parameter, isAllowNullable)); sbMethodList.Append(parameter.Direction.ToString() + parameter.IsNullable.ToString()); break; case ParamDirection.InputOutput: count++; if(count>1) { sbMethodList.Append(","); } sbMethodList.Append(ProceduceParameterGenerationHelper.GenerateMethodByParameter(parameter, isAllowNullable)); sbMethodList.Append(parameter.Direction.ToString() + parameter.IsNullable.ToString()); break; case ParamDirection.Input: count++; if(count>1) { sbMethodList.Append(","); } sbMethodList.Append(ProceduceParameterGenerationHelper.GenerateMethodByParameter(parameter, isAllowNullable)); sbMethodList.Append(parameter.Direction.ToString() + parameter.IsNullable.ToString()); break; case ParamDirection.Unknown: break; } } return sbMethodList.ToString(); }
public static string GenerateProceduceParametersMethodListForTable(IProcedure procedure, ITable table, bool isAllowNullable) { StringBuilder sbMethodList = new StringBuilder(); int count = 0; foreach (IParameter parameter in procedure.Parameters) { IColumn column = GenerateColumnByProcedure(parameter, table); if (column==null) continue; switch (parameter.Direction) { case ParamDirection.ReturnValue: break; case ParamDirection.Output: case ParamDirection.InputOutput: case ParamDirection.Input: count++; if (count > 1) { sbMethodList.Append(","); } sbMethodList.Append(ProceduceParameterGenerationHelper.GenerateMethodByParameter(parameter, column.IsNullable)); //sbMethodList.Append(parameter.Direction.ToString() + "----" + column.Name + column.IsNullable.ToString()); break; case ParamDirection.Unknown: break; } } return sbMethodList.ToString(); }