src/Inflatable/ClassMapper/Default/Reference.cs
/// <summary>
/// Converts this instance to the class specified
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="mapping">The mapping.</param>
/// <returns>The resulting property</returns>
Converts this instance to the class specified
Converts this instance to the class specified
public override IProperty Convert<TResult>(IMapping mapping)
        {
            var Result = new ExpressionTypeConverter<ClassType, DataType>(Expression).Convert<TResult>();
            var ReturnObject = new Reference<TResult, DataType>(Result, mapping);
            if (Index)
            {
                ReturnObject.IsIndexed();
            }
            if (ReadOnly)
            {
                ReturnObject.IsReadOnly();
            }
            if (Unique)
            {
                ReturnObject.IsUnique();
            }
            ReturnObject.WithColumnName(ColumnName);
            ReturnObject.WithComputedColumnSpecification(ComputedColumnSpecification);
            for (int x = 0, ConstraintsCount = Constraints.Count; x < ConstraintsCount; x++)
            {
                var Constraint = Constraints[x];
                ReturnObject.WithConstraint(Constraint);
            }
            ReturnObject.WithDefaultValue(DefaultValue);
            ReturnObject.WithMaxLength(MaxLength);
            return ReturnObject;
        }
public override IProperty Convert < TResult > ( IMapping mapping ) { var Result = new ExpressionTypeConverter < ClassType , DataType > ( Expression ) . Convert < TResult > ( ) ; var ReturnObject = new Reference < TResult , DataType > ( Result , mapping ) ; if ( Index ) { ReturnObject . IsIndexed ( ) ; } if ( ReadOnly ) { ReturnObject . IsReadOnly ( ) ; } if ( Unique ) { ReturnObject . IsUnique ( ) ; } ReturnObject . WithColumnName ( ColumnName ) ; ReturnObject . WithComputedColumnSpecification ( ComputedColumnSpecification ) ; for ( int x = 0 , ConstraintsCount = Constraints . Count ; x < ConstraintsCount ; x ++ ) { var Constraint = Constraints [ x ] ; ReturnObject . WithConstraint ( Constraint ) ; } ReturnObject . WithDefaultValue ( DefaultValue ) ; ReturnObject . WithMaxLength ( MaxLength ) ; return ReturnObject ; }
Converts this instance to the class specified
Converts this instance to the class specified
The resulting property
The resulting property
mapping
IMapping
None
typeparam
The type of the result.
The type of the result .