public static ProcedureNode Create(XElement element) { string attribuleValue; var info = new ProcedureNode(); info._parameterList = new List <ProcedureParameterNode>(); if (MappingInfo.GetAttribuleValue(element, "name", out attribuleValue)) { info._name = attribuleValue; } if (MappingInfo.GetAttribuleValue(element, "procedure", out attribuleValue)) { info._procedure = attribuleValue; } if (MappingInfo.GetAttribuleValue(element, "schema", out attribuleValue)) { info._schema = attribuleValue; } foreach (var property in element.Elements()) { var parameter = ProcedureParameterNode.Create(property); info.ParameterList.Add(parameter); } return(info); }
public static ProcedureParameterNode Create(XElement property) { var attribuleValue = string.Empty; var parameter = new ProcedureParameterNode(); if (MappingInfo.GetAttribuleValue(property, "name", out attribuleValue) || !(attribuleValue = property.Name.LocalName).Equals("parameter")) { parameter._name = attribuleValue; } if (MappingInfo.GetAttribuleValue(property, "output", out attribuleValue)) { bool isoutput; parameter._isOutPut = bool.TryParse(attribuleValue, out isoutput) ? isoutput : false; } if (MappingInfo.GetAttribuleValue(property, "dbType", out attribuleValue)) { parameter._dbType = attribuleValue; } if (MappingInfo.GetAttribuleValue(property, "size", out attribuleValue)) { int size; parameter._size = int.TryParse(attribuleValue, out size) ? (int?)size : null; } return(parameter); }