hcaldeira wrote:
Hi, thanks for fast replay.
You are right, if we use the default structure of generated projects, the classes must be public, if not, we cannot create classes from our assemblies. But as I state before, I want to encapsulate LLBLGen classes inside a layer.
To accomplish this, I had to change the templates to not generate projects *.cproj, then I included the files manually in my project, example:
DataAccessLayer.csproj [My project manually created]
DatabaseGeneric [Folder]
EntityClasses [Folder]
FactoryClasses [Folder]
....
DatabaseSpecific [Folder]
ActionProcedures.cs
...
I hope you understand my structure, I can post an image if it helps.
thanks.
HC
Ok, though this mitigates the factor that the databasespecific code is factored out in its own project to make possible what you want: work with the entities and not being able to do any data-access actions as that requires the database specific code.
I think you can do this though using the following:
separate the databasespecific project in a different project. This is required.
In dataaccesslayer, program against IDataAccessAdapter, this is an interface implemented on DataAccessAdapter. You binary reference the databasespecific project in dataaccesslayer. In dataaccesslayer you create a small internal factory where you do:
internal IDataAccessAdapter CreateDataAccessAdapter()
{
return new DataAccessAdapter();
}
referencing the dataaccesslayer then won't offer the public DataAccessAdapter as well. Am I correct?