예제 #1
0
        public void UseNamesFromConfigurationMap()
        {
            var modelMapper = new ConventionModelMapper();

            modelMapper.SetColumnName <Foo, string>(p => p.PropertyString, "Address");
            modelMapper.SetColumnName <Foo, double>(p => p.PropertyDouble, "Salary");

            var tableInfo = modelMapper.GetTableInfo <Foo>();

            var address = tableInfo.GetColumnInfoByPropertyName(nameof(Foo.PropertyString));
            var salary  = tableInfo.GetColumnInfoByPropertyName(nameof(Foo.PropertyDouble));

            address.Name.Should().Be("Address");
            salary.Name.Should().Be("Salary");
        }