Esempio n. 1
0
        private bool IsSqlServerSpecificType(Type type)
        {
            if (MapEmitAssembly.IsSqlServerSpecificType(type) == false)
            {
                return(false);
            }

            this.HasSqlServerSpecificFields = true;
            return(true);
        }
Esempio n. 2
0
        public void MapType()
        {
            var properties = typeof(T).GetProperties()
                             .Where(property => MapEmitAssembly.IsValidType(property.PropertyType));

            foreach (var propertyInfo in properties)
            {
                var allowNulls = propertyInfo.PropertyType.DoesPropertySupportNull();
                this.Map(propertyInfo, propertyInfo.Name, allowNulls, null);
            }
        }
Esempio n. 3
0
        private void Map(PropertyInfo destinationProperty, string sourceColumn, bool allowNulls, object defaultValue)
        {
            CheckDefaultValuePreConditions(destinationProperty, allowNulls, defaultValue);
            var isSqlServerSpecificType = this.IsSqlServerSpecificType(destinationProperty.PropertyType);

            MapEmitAssembly.CheckValidType(destinationProperty);
            var fieldMapDefinition = new FieldMapDefinition(
                destinationProperty,
                sourceColumn ?? destinationProperty.Name,
                allowNulls,
                defaultValue,
                isSqlServerSpecificType);

            this.FieldMapDefinitions[destinationProperty] = fieldMapDefinition;
        }