_Core/Mapper/AutoMapperSettings.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ComLib
{
    /// <summary>
    /// Configuration settings for mapper
    /// </summary>
    public class AutoMapperSettings
    {
        /// <summary>
        /// Default settings.
        /// </summary>
        public static readonly AutoMapperSettings Default = new AutoMapperSettings()        
        {
             CatchErrors = false,
             AutoCreateNestedObjects = true,
             MapNestedObjects = true,
             NameFilter = null,
             IsCaseSensitive = false,
             NestedObjectSeparator = ".",
             RemoveNameFilterWhenMapping = true
        };


        /// <summary>
        /// Default initialization
        /// </summary>
        public AutoMapperSettings() { }


        /// <summary>
        /// Initialize
        /// </summary>
        /// <param name="catchErrors">Whether or not to catch errors.</param>
        /// <param name="isCaseSensitive">Whether or not to consider case sensitivity in mapping properties</param>
        /// <param name="mapNestedObjects">Whether or not to map nested objects</param>
        /// <param name="namedFilter">A filter used as a prefix on the source properties to map. eg. p_age: p_ is the prefix.</param>
        /// <param name="removeNameFilterWhenMapping">Whether or not to remove the name filter from the destination property when mapping.
        ///     e.g. mapping from source "p_Name" with prefix "p_" and remove "p_" when mapping to destination "Name".
        /// </param>
        public AutoMapperSettings(bool catchErrors, bool isCaseSensitive, bool mapNestedObjects, string namedFilter, bool removeNameFilterWhenMapping)
        {
            CatchErrors = catchErrors;
            IsCaseSensitive = isCaseSensitive;
            MapNestedObjects = mapNestedObjects;
            NestedObjectSeparator = ".";
            NameFilter = namedFilter;
            RemoveNameFilterWhenMapping = removeNameFilterWhenMapping;
        }


        /// <summary>
        /// Whether or not to catch errors.
        /// </summary>
        public bool CatchErrors;


后面还有 37 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。