none
WPF Calling API RRS feed

  • Question

  • Hello all,

    I have a solution with the following layers:
    1. API (.Net Core 2.2)

    2. DataAcess

    3. Repository

    4. Layers

    5 Models

    Now I have added an another layer for the WPF Application.
    At this moment in my application, I need to call the Service layer of the solution but having problems when doing dependency injection because it always return null.

    My question is:
    Is it ok for a WPF App call the Services layer directly  ?
    Or should I call the API layer instead, calling the controllers ?

    Thx

    Wednesday, October 9, 2019 7:17 PM

All replies

  • Now I have added an another layer for the WPF Application.
    At this moment in my application, I need to call the Service layer of the solution but having problems when doing dependency injection because it always return null.

    This should not be an issue if an IoC is being used.

    My question is:

    Is it ok for a WPF App call the Services layer directly ? 

    IMO, you should be implementingSoC where the WPF the presentation layer calls  class objects in the domain aka the business layer, objects in BL call objects in the service layer with objects in the service layer communicating with the WebAPI service.

    Or should I call the API layer instead, calling the controllers ?

    The presentation layer should not be making calls to the WebAPI, IMO.

    Wednesday, October 9, 2019 10:33 PM