Project DescriptionInspired by the
Fluent NHibernate project, Fluent Linq to Sql allows you to define mappings for Linq to Sql entities using a fluent interface rather than attributes or XML.
NOTE This project is no longer under active development.
Example Mapping
public class CustomerMapping : Mapping<Customer> {
public CustomerMapping() {
Identity(customer => customer.Id);
Map(customer => customer.Name);
HasMany(customer => customer.Orders).OtherKey(order => order.CustomerId);
}
}
var mappingSource = new FluentMappingSource("Mydatabase");
mappingSource.AddFromAssemblyContaining<CustomerMapping>();
var dataContext = new DataContext("connection-string", mappingSource);
var customers = from c in dataContext.GetTable<Customer>() select c;
Documentation
Build ServerTeamCityLast Successful BuildCode Coverage