/// <summary> /// Define o tipo de dado do campo. /// </summary> /// <param name="field">O campo a ser modificado.</param> /// <param name="dataType">A categoria do campo.</param> /// <returns>A própria instância do campo modificado.</returns> public static Field SetType(this Field field, Type fieldType) { var dataType = DataTypeNames.FromType(fieldType); field.Type = FieldTypeNames.FromDataType(dataType); return(field); }
public static string MakeDataType(MemberInfo member) { Type type; if (member is Type) { type = (Type)member; } else if (member is FieldInfo field) { type = field.FieldType; } else if (member is PropertyInfo property) { type = property.PropertyType; } else { return(null); } return(DataTypeNames.FromType(type) ?? DataTypeNames.String); }
public static string MakeDataType(DataColumn col) { return(DataTypeNames.FromType(col.DataType) ?? DataTypeNames.String); }
public static string MakeDataType(ParameterInfo parameter) { var type = parameter.ParameterType; return(DataTypeNames.FromType(type) ?? DataTypeNames.String); }
public static string MakeDataType(Type type) { return(DataTypeNames.FromType(type) ?? DataTypeNames.String); }