problem to pass data between layers

  • Thread starter Thread starter zleug
  • Start date Start date
Z

zleug

Guest
Hi All.

I have multiple layers solution. The DataLayer has Employee Entity Framework class table. In this layer I created EmployeeFactory class with GetEmployee() method.

public static List<Employee> GetEmployees()
{
var context = new Model1());
return employeedg = context.Employees.AsNoTracking.ToList();
}

The BusynessLayer has reference DataLayer. And in this layer created class EmployeeAdapter class with method

public static List<Employee> GetEmployees()
{
return EmployeeFactory.GetEmployees();
}

The UI layer has BusynessLayer reference. And to populate WPF DataGrid I create in form class method

public void SetEmployee_DG()
{
var employees = EmployeeAdapter.GetEmployees();
Employee_DG.ItemsSource = employees;
}

But EmployeeAdapter.GetEmployee() display error point to add reference DataLayer to UI layer that I don't want to do.

How to solve this problem? Thanks.

Continue reading...
 
Back
Top