DapperExtensions.Mapper.PropertyMap.Column C# (CSharp) Méthode

Column() public méthode

Fluently sets the column name for the property.
public Column ( string columnName ) : PropertyMap
columnName string The column name as it exists in the database.
Résultat PropertyMap
        public PropertyMap Column(string columnName)
        {
            ColumnName = columnName;
            return this;
        }

Usage Example

 public void PropertyMap_Column_Sets_ColumnName_But_Does_Not_Change_Name()
 {
     Expression<Func<Foo, object>> expression = f => f.Baz;
     var pi = ReflectionHelper.GetProperty(expression) as PropertyInfo;
     PropertyMap pm = new PropertyMap(pi);
     pm.Column("X");
     Assert.AreEqual("Baz", pm.Name);
     Assert.AreEqual("X", pm.ColumnName);
 }
All Usage Examples Of DapperExtensions.Mapper.PropertyMap::Column