Project Description
Inspired 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.

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 Server
TeamCity
Last Successful Build
Code Coverage
Last edited Sep 6 2009 at 2:39 PM by JeremyS, version 12

 

Want to leave feedback?
Please use Discussions or Reviews instead.

Archived page comments (1)

Updating...
© 2006-2010 Microsoft | Get Help | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2010.2.24.16331