Contains mapping options
예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MappingRepository"/> class.
        /// </summary>
        /// <param name="optionsFunc">
        /// A lambda for options setup.
        /// </param>
        public MappingRepository(Func <IRepositorySpec, IRepositorySpec> optionsFunc)
        {
            Guard.CheckArgumentNotNull(optionsFunc, "optionsFunc");
            IRepositorySpec repoSpec = new RepositorySpec();

            repoSpec     = optionsFunc(repoSpec);
            this.options = repoSpec.GetOptions();
        }
예제 #2
0
        public void MappingOptionsConstructorTest()
        {
            var mapperOrder = new Type[]
            {
                typeof(AttributeMapper<,>),
                typeof(ManualMapper<,>),
                typeof(ConventionMapper<,>),
            };

            var target = new MappingOptions(mapperOrder);
            var targetOrder = target.MapperOrder.ToArray();

            for (var i = 0; i < mapperOrder.Length; ++i)
            {
                Assert.AreEqual(mapperOrder[i], targetOrder[i]);
            }
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MappingRepository"/> class.
 /// </summary>
 /// <param name="options">The mapping options to be used by this repository's mappers.</param>
 public MappingRepository(MappingOptions options)
 {
     this.options = options;
 }