Saturday, October 4, 2014

Three layer architecture with .net, WPF, C#

For create a three layer architecture project, first create a solution with your main project.
example: Solution 'SHOPMS' with C# WPF Project SHOPMS.

Now you have to add another four new project to this solution.

1. Right click on the solution, click Add, then New Project.
    -> In Add New Project window, select Visual C# -> Class Library. Name it BLL (Business Logic Layer)

2. Add next Class Library Project and Name it DAL (Data Access Layer)

3. Add next Class Library Project and Name it DATA

4. Add next Class Library Project and Name it ENTITY

Now it's time to add reference to the projects........

1. In the main project SHOPMS add reference of BLL & ENTITY
2. In BLL project add reference of DAL & ENTITY
3. In DAL project add reference of DATA & ENTITY

So, Main Project SHOPMS only have access of BLL & ENTITY
BLL only know DAL & ENTITY
and DAL only know DATA & ENTITY

Note: DAL project also need reference of EntityFramework

No comments:

Post a Comment