Do you see any need to add functionality that would add a value to the table that is outside of the model properties? The example below would add the value 'student' to the category column in the People table.
var mapper = new MapperBuilder<Person>()
.SetTableName("People") // could be ommited if your table's name is the same as you entity's class name
.AddMapping(person => person.FirstName, columnName: "Name")
.AddMapping(person => person.LastName, columnName: "Surename")
.AddMapping(person => person.DateOfBirth) // in this case property's name is the same as table column's name
.AddConstant("student", columnName: "Category")
.Build();
//Don't want to alter the person model!!!!
var people = new List<Person>()
{
new Person() { FirstName = "John", LastName = "Lennon", DateOfBirth = new DateTime(1940, 10, 9) },
new Person() { FirstName = "Paul", LastName = "McCartney", DateOfBirth = new DateTime(1942, 6, 18) },
};
Do you see any need to add functionality that would add a value to the table that is outside of the model properties? The example below would add the value 'student' to the category column in the People table.