locked
problem to pass data between layers RRS feed

  • Question

  • Hi All.

    I have multiple layers solution. The Data Layer has Entity Framework Model1 with Employee class table. In this layer I created EmployeeFactory class with GetEmployees() method.

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

    The Busyness Layer has Data Layer reference. And in this layer created class EmployeeAdapter with method

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

    The UI Layer has Busyness Layer reference. And to populate WPF DataGrid I created method

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

    But EmployeeAdapter.GetEmployees() display error and point to add Data Layer reference to UI Layer that I don't want to do.

    How to solve this problem? Thanks.




    • Edited by zleug Saturday, August 8, 2020 12:28 AM
    Saturday, August 8, 2020 12:03 AM

Answers

All replies