curiouswebster
asked on
Creating a database context
I worked on a DDD project not long ago using the IRepository pattern. To save the addition of a new object, we'd called the Save() method of the POCO's IRepository object.
Last, we'd call Commit() on the database context.
I am having trouble putting all that together on my own project.
Could someone show me some sample code that associates an IRepository and a database context?
Thanks,
newbieweb
Last, we'd call Commit() on the database context.
I am having trouble putting all that together on my own project.
Could someone show me some sample code that associates an IRepository and a database context?
Thanks,
newbieweb
"Database context" suggests that you are using something like Entity Framework, but that's just a guess...
ASKER
It could be EF but does not need to be. Let's try this with EF.
Using Code First, I need to learn how to associate an instance of IRepository, associated with a POCO, with a database context. I say POCO, since there's not need to use a partial class, when it's Schema First.
newbieweb
Using Code First, I need to learn how to associate an instance of IRepository, associated with a POCO, with a database context. I say POCO, since there's not need to use a partial class, when it's Schema First.
newbieweb
ASKER
" I say POCO, since there's NO need to use the partial class (generated by EF), AS when it's Schema First."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That should keep me busy until I get more questions.
Thanks,
newbieweb
Thanks,
newbieweb