Castle.ActiveRecord.Framework.Internal.SemanticVerifierVisitor.VisitField C# (CSharp) Méthode

VisitField() public méthode

Visits the field.
Infer column name and nullablity
public VisitField ( FieldModel model ) : void
model FieldModel The model.
Résultat void
		public override void VisitField(FieldModel model)
		{
			if (model.FieldAtt.Column == null)
			{
				model.FieldAtt.Column = model.Field.Name;
			}

			// Append column prefix
			model.FieldAtt.Column = columnPrefix + model.FieldAtt.Column;

			Type fieldType = model.Field.FieldType;

			if (NHibernateNullablesSupport.IsNHibernateNullableType(fieldType) &&
			    (model.FieldAtt.ColumnType == null || model.FieldAtt.ColumnType.Length == 0))
			{
				model.FieldAtt.NotNull = false;
				model.FieldAtt.ColumnType = NHibernateNullablesSupport.GetITypeTypeNameForNHibernateNullable(fieldType);
			}

			if (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(Nullable<>) &&
			    String.IsNullOrEmpty(model.FieldAtt.ColumnType))
			{
				model.FieldAtt.NotNull = false;
				model.FieldAtt.ColumnType = ObtainNullableTypeNameForCLRNullable(fieldType);
			}
		}