Hi, my application has several databases and Vince recommends the following
publicabstractclassENTBaseData<T, DC>
where T : IENTBaseEntity
where DC: DataContext, new()
{
publicabstractList<T> Select();
publicabstract T Select(int id);
publicabstractvoid Delete(DC db, int id);
publicvoid Delete(string connectionString, int id)
{
using (DC db = new DC(connectionString))
{
Delete(db, id);
}
}
1 - I am using
vb.net which does not seem to allow the connectionString argument
in : using db as new DC(connectionString) etc..
2 - I have declared my ENTBaseEO as follows:
PublicMustInheritClass ENTBaseEO(Of DC As {DataContext, New})
Inherits ENTBaseBO
Every thing is OK until I reach the baseEditPage master class where I have to specify which
datacontext I am using. I am reluctant to have the UI reference the DAL.
Any idea would appreciated
regards