本文整理汇总了C#中ParameterDirection.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterDirection.ToString方法的具体用法?C# ParameterDirection.ToString怎么用?C# ParameterDirection.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterDirection
的用法示例。
在下文中一共展示了ParameterDirection.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnsupportedTVPOutputParameter
internal static Exception UnsupportedTVPOutputParameter(ParameterDirection direction, string paramName)
{
return ADP.NotSupported(Res.GetString("SqlParameter_UnsupportedTVPOutputParameter", new object[] { direction.ToString(), paramName }));
}
示例2: InvalidParameterDirection
// IDataParameter.Direction
static internal ArgumentOutOfRangeException InvalidParameterDirection(ParameterDirection value)
{
#if DEBUG
switch (value)
{
case ParameterDirection.Input:
case ParameterDirection.Output:
case ParameterDirection.InputOutput:
case ParameterDirection.ReturnValue:
Debug.Assert(false, "valid ParameterDirection " + value.ToString());
break;
}
#endif
return InvalidEnumerationValue(typeof(ParameterDirection), (int)value);
}
示例3: ParameterProperty
/// <summary>
/// Initializes a new instance of the <see cref="ParameterProperty"/> class.
/// </summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="columnName">Name of the column.</param>
/// <param name="callBackName">Name of the call back.</param>
/// <param name="clrType">Type of the CLR.</param>
/// <param name="dbType">Type of the db.</param>
/// <param name="directionAttribute">The direction attribute.</param>
/// <param name="nullValue">The null value.</param>
/// <param name="precision">The precision.</param>
/// <param name="scale">The scale.</param>
/// <param name="size">The size.</param>
/// <param name="parameterClass">The parameter class.</param>
/// <param name="dataExchangeFactory">The data exchange factory.</param>
public ParameterProperty(
string propertyName,
string columnName,
string callBackName,
string clrType,
string dbType,
string directionAttribute,
string nullValue,
Byte precision,
Byte scale,
int size,
Type parameterClass,
DataExchangeFactory dataExchangeFactory
)
{
Contract.Require.That(propertyName, Is.Not.Null & Is.Not.Empty).When("retrieving argument propertyName in ParameterProperty constructor");
this.columnName = columnName;
this.callBackName = callBackName;
this.clrType = clrType;
this.dbType = dbType;
this.nullValue = nullValue;
this.precision = precision;
this.scale = scale;
this.size = size;
#region Direction
if (directionAttribute.Length > 0)
{
direction = (ParameterDirection)Enum.Parse(typeof(ParameterDirection), directionAttribute, true);
this.directionAttribute = direction.ToString();
}
#endregion
#region Property Name
this.propertyName = propertyName;
if (propertyName.IndexOf('.') < 0)
{
isComplexMemberName = false;
}
else // complex member name FavouriteLineItem.Id
{
isComplexMemberName = true;
}
#endregion
#region GetAccessor
if (!typeof(IDictionary).IsAssignableFrom(parameterClass) // Hashtable parameter map
&& parameterClass != null // value property
&& !dataExchangeFactory.TypeHandlerFactory.IsSimpleType(parameterClass)) // value property
{
if (!isComplexMemberName)
{
IGetAccessorFactory getAccessorFactory = dataExchangeFactory.AccessorFactory.GetAccessorFactory;
getAccessor = getAccessorFactory.CreateGetAccessor(parameterClass, propertyName);
}
else // complex member name FavouriteLineItem.Id
{
string memberName = propertyName.Substring(propertyName.LastIndexOf('.') + 1);
string parentName = propertyName.Substring(0, propertyName.LastIndexOf('.'));
Type parentType = ObjectProbe.GetMemberTypeForGetter(parameterClass, parentName);
IGetAccessorFactory getAccessorFactory = dataExchangeFactory.AccessorFactory.GetAccessorFactory;
getAccessor = getAccessorFactory.CreateGetAccessor(parentType, memberName);
}
}
#endregion
#region TypeHandler
if (CallBackName.Length > 0)
{
try
{
Type type = dataExchangeFactory.TypeHandlerFactory.GetType(CallBackName);
ITypeHandlerCallback typeHandlerCallback = (ITypeHandlerCallback)Activator.CreateInstance(type);
typeHandler = new CustomTypeHandler(typeHandlerCallback);
}
catch (Exception e)
{
throw new ConfigurationException("Error occurred during custom type handler configuration. Cause: " + e.Message, e);
}
}
else
{
if (CLRType.Length == 0) // Unknown
//.........这里部分代码省略.........
示例4: InvalidParameterDirection
internal static ArgumentOutOfRangeException InvalidParameterDirection (ParameterDirection value)
{
object [] args = new object [] { "ParameterDirection", value.ToString () } ;
return new ArgumentOutOfRangeException (GetExceptionMessage ("Invalid direction '{0}' for '{1}' parameter.",args));
}
示例5: Parse
protected virtual System.Data.ParameterDirection Parse(ParameterDirection direction)
{
return (System.Data.ParameterDirection) Enum.Parse(typeof(System.Data.ParameterDirection), direction.ToString());
}