Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to use UnitOfWork? #3

Open
mahdi87gh opened this issue Apr 12, 2016 · 0 comments
Open

[Question] How to use UnitOfWork? #3

mahdi87gh opened this issue Apr 12, 2016 · 0 comments
Assignees
Labels

Comments

@mahdi87gh
Copy link

mahdi87gh commented Apr 12, 2016

Hi,
Thanks for your great work here. I have a question to ask. Here is my test project hierarchy :
-Solution
--Test.DomainModel
-- Test.Repo
--Test.Api

In DomainModel class library just there are my entity models.
In Repo class library I added your nuget package and generated Repositories and unit of work.
In Api winApp I tried something like this code just for testing:

using (var db = new UnitOfWork())
            {
               var item = db.Barbers.GetById(textBox1.Text);
               MessageBox.Show(item.BarberName);
            }

It fails to run, Needs for a connection string in my Api project! Which is already defined in Repo and DomainModel projects. When I copy the connection string from these projects to Api project app.config file, I get error for Needing entityframework and system.data.sqlClient dlls . Why is like this. When I'm using a repository, shouldn't it handle these things?! I wish not to include entityFramework to my Api project. By the way could you upload a sample project ?

@OmarElabd OmarElabd self-assigned this Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants