예제 #1
0
        bool IMappingEngineRunner.ShouldMapSourceCollectionAsNull(ResolutionContext context)
        {
            var typeMap = context.GetContextTypeMap();

            if (typeMap != null)
            {
                return(ConfigurationProvider.GetProfileConfiguration(typeMap.Profile).AllowNullCollections);
            }

            return(ConfigurationProvider.AllowNullCollections);
        }
예제 #2
0
        bool IMappingEngineRunner.ShouldMapSourceValueAsNull(ResolutionContext context)
        {
            if (TypeExtensions.IsValueType(context.DestinationType) &&
                !PrimitiveExtensions.IsNullableType(context.DestinationType))
            {
                return(false);
            }

            var typeMap = context.GetContextTypeMap();

            if (typeMap != null)
            {
                return(ConfigurationProvider.GetProfileConfiguration(typeMap.Profile).AllowNullDestinationValues);
            }

            return(ConfigurationProvider.AllowNullDestinationValues);
        }