• eferences > Add references
  • Employees.Model
  • Class
  • In GetEmployees() Funtion
  • Add a EmployeeDataServices class




    Download 2,23 Mb.
    bet4/16
    Sana20.03.2020
    Hajmi2,23 Mb.
    #8262
    1   2   3   4   5   6   7   8   9   ...   16

    Add a EmployeeDataServices class


    EmployeeDataServices class will implement the IEmployeeDataSerivces interface which we created in Employees.Interface project. First, we need to add the .dll of Employees.Interface project.

    To add dll, Right-click on References > Add references, then look for the Employees.Interface project’s bin folder, then select the Employees.Interface.dll , then Add.

    And also, we need to reference the Employees.Model project to the Employees.DataService Project. To do so, just follow the same steps as described above. But here we need to look in Employees.Model project.

    Next, add EmployeeDataServices class. Right-click the Employees.DataServices Project folder and select Add > New Item.

    In the Add New Item dialog, select the Class template. Name the class EmployeeDataServices and click OK.

    Then we need to add namespace of Employees.Interface project to the EmployeeDataServices.cs class.



    Replace the generated code with the below:



    In GetEmployees() Funtion,

    We will create a new employees list object to fill with the employees details.

    GetAllEmployees() Function ,is used to get the employees list and return the same to API Project.



    Download 2,23 Mb.
    1   2   3   4   5   6   7   8   9   ...   16




    Download 2,23 Mb.