dsuryd / dotNetify-react-template

Real-time React SPA template using dotNetify.
https://dotnetify.net/react
Apache License 2.0
203 stars 57 forks source link

Dependency Injection in DataService #17

Closed webiox closed 6 years ago

webiox commented 6 years ago

Hi, I wanna fetch data from my repository in a different project as my Data/Service Layer and present it in example dashboard project. how can I inject my repository service in "MockLiveDataService.cs" and show the fetched value just like "Download" or "upload" value? when I reference the dashboard project to my data/service layer project and inject targeted service to "MockLiveDataService.cs" and run the project, project starts and stops and responds "HTTP Error 502.5 - Process Failure" exception.

dsuryd commented 6 years ago

Inject it the same way you would with ASP.NET Core DI. That error was probably caused by DLL version mismatch; see here: https://github.com/aspnet/IISIntegration/issues/406

webiox commented 6 years ago

Thank you for your response @dsuryd! Great job and good luck