Exemplo n.º 1
0
        /// <inheritdoc />
        public override IFieldProperties GetDatabaseFieldProperties(IFieldProperties field)
        {
            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            var result = field.Clone();

            result.NameAtDatabase = GetObjectName(field.Name);
            switch (field.DataType)
            {
            case DataType.UInt8:
                result.TypeAtDatabase = DataType.Int16;
                break;

            case DataType.UInt16:
                result.TypeAtDatabase = DataType.Int32;
                break;

            case DataType.UInt32:
                result.TypeAtDatabase = DataType.Int64;
                break;

            case DataType.UInt64:
                result.TypeAtDatabase = DataType.Decimal;
                break;
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public override IFieldProperties GetDatabaseFieldProperties(IFieldProperties field)
        {
            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            switch (field.DataType)
            {
            case DataType.DateTime:
                var result = field.Clone();
                result.ValueType = typeof(DateTime);
                return(result);
            }

            return(base.GetDatabaseFieldProperties(field));
        }
Exemplo n.º 3
0
        /// <inheritdoc />
        public override IFieldProperties GetDatabaseFieldProperties(IFieldProperties field)
        {
            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            switch (field.DataType)
            {
            case DataType.Int8:
                var result = field.Clone();
                result.TypeAtDatabase = DataType.Int16;
                return(result);
            }

            return(base.GetDatabaseFieldProperties(field));
        }
Exemplo n.º 4
0
        /// <inheritdoc />
        public override IFieldProperties GetDatabaseFieldProperties(IFieldProperties field)
        {
            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            var typeAtDatabase = GetDatabaseDataType(field.DataType);

            if (field.TypeAtDatabase != typeAtDatabase)
            {
                var result = field.Clone();
                result.TypeAtDatabase = typeAtDatabase;
                return(result);
            }

            return(field);
        }