Hi,
I am currently setting the connection string for my linq to sql data context by using a wrapper class so that I can pass a connection string into the generated DataContext constructor:
public class DB : GeneratedDataContext {
public DB() : base(ConfigurationManager.ConnectionStrings["myconnectionstring"].ConnectionString) { }
}
My LinqToSql repository implementations then work with the DB class directly.
I am using StructureMap and wonder whether this is the best approach for this i.e. should I instead, take a connection string parameter as a constructor on my repository and set this argument within my StructureMap boot strapper?
Thanks, Ben