Пример #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;
 }