Why doesn't my assembly see it's own entities?
Why doesn't my assembly see it's own entities?
I am getting this error
Quote:
'HLP_DB.HLP': type used in a using statement must be implicitly convertible to 'System.IDisposable'
I don't get it, I have created a class library with the name space HLP_DB, in that I created a Entity Framework model HLP.
I have added a reference from my application class library project to my DB ORM class library (using HLP_DB). HLP derives from DbContext, and in that class it is using the name space System.Data.Entity.
If I am referencing an assembly that itself uses all the correct name spacing and derives from the needed classes that includes the interface IDisposable, why am I getting this error.
I'm using a class from a referenced project, it has all it needs to know to create an object of that class, why is my application class expecting me to reference the System.Data.Entity namespace, I'm not trying to use that namespace the object I'm instantiating is and correctly references it?
I'm trying to abstract away my ORM to a helper assembly that multiple applications can use, but seem to be hitting a brick wall.
I'm confused and would appreciate some guidance.
Thanks,
1DMF.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
RE: Why doesn't my assembly see it's own entities?
And tried the NuGet Package suggestion and now it's working as expected?
I still don't understand, my application class library is not using the EF, it's using an assembly that is, which correctly references the EF.
I thought using assemblies and classes are meant to be black boxes, I should not have to know or care about their implementation, and I wouldn't expect to have to include references to their dependencies, they do that themselves don't they?
Clarification would be appreciated.
1DMF.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
RE: Why doesn't my assembly see it's own entities?
I don't want to hard code a connection string in app.config in each application I want this stored in the folder where all the model classes are stored for the helper ORM class assembly library?
I want it DRY and in one place used by the helper class library, not in each application directory folder.
This is getting annoying!
I must be missing something and would appreciate some assistance.
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
RE: Why doesn't my assembly see it's own entities?
CODE
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
RE: Why doesn't my assembly see it's own entities?
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music