Best practice to use IResult in a class library
See original GitHub issueWhat is the best way to use the new IResult
type in a class library?
I did abstract / port some code to a shared library (2 edge api’s, one shared api lib) but I really struggled to get the IResult
type and Results
factory in the lib.
My first reaction was to find it in nuget packages like Microsoft.AspNetCore.Http
, Microsoft.AspNetCore.Http.Extensions
or Microsoft.AspNetCore.Http.Abstractions
but no success.
Then I remembered that the whole distribution of frameworks did change. In the old days everything was distributed via NuGet but now the frameworks/app models are distributed as SDK that you install on your machine. So the dlls are right there but how to reference it?
I think the Nuget packages above are not updated anymore, thats correct?
One way to fix it, is to change the csproject to <Project Sdk="Microsoft.NET.Sdk.Web">
and then it works.
But it does feel a bit ‘heavy’, only when you want to reference 1 type and access one factory.
So whats best practice on this?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
If such a support were to exist, I would assume it needs to be more generic than just for Web projects. May be something for the project system backlog - https://github.com/dotnet/project-system?
Thanks @DamianEdwards. Closing this issue.