AutoWrapper icon indicating copy to clipboard operation
AutoWrapper copied to clipboard

.NET 5.0 support

Open mattmckinstry opened this issue 3 years ago • 18 comments

Is it possible to release a version with .NET 5.0 support?

mattmckinstry avatar Nov 25 '20 14:11 mattmckinstry

Yes. The plan is also to migrate or atleast support System.Text.Json. Been busy at work these days but will work on it when time permits. It's on my priority list :)

proudmonkey avatar Nov 25 '20 16:11 proudmonkey

Updates - The .NET 5 migration is currently still on-hold because my son was admitted in the hospital. I'll resume the migration hopefully next week when everything is okay. You can see the work I've started here: https://github.com/proudmonkey/AutoWrapper/tree/v5-beta

Thanks, Vince

proudmonkey avatar Mar 24 '21 16:03 proudmonkey

Hope your son gets well soon

mattmckinstry avatar Mar 24 '21 17:03 mattmckinstry

Hope your son gets well soon. praying for your son.

On Wed, Mar 24, 2021 at 10:20 PM Matt McKinstry @.***> wrote:

Hope your son gets well soon

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/proudmonkey/AutoWrapper/issues/86#issuecomment-806011313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHKQ3HLW7RGPI6KULN6WG3TFINOBANCNFSM4UCQBDEA .

-- Best Regard: Sajid Ali Software Engineer (+92) 333 6528504 / 321 786 5510

sajidali2444 avatar Mar 25 '21 08:03 sajidali2444

Hi :) Hope your son is doing better.

Do you have an estimate of when support for 5 will be released? I'm in the situation that I need to hand the project in at the end of the month, if you won't have the time, it's totally understandable just wish to know before it's to late to work around it.

Best regards and wishes Peter

PBonvang avatar Apr 12 '21 12:04 PBonvang

Any news about the improvements? @proudmonkey

gokmensercan avatar Jun 10 '21 19:06 gokmensercan

https://www.nuget.org/packages/AutoWrapper.Core.Net5/4.5.1

@proudmonkey seems someone added support for .NET5, if you can extend this to include .NET6, that would be great

zoinkydoink avatar Jun 11 '21 15:06 zoinkydoink

https://www.nuget.org/packages/AutoWrapper.Core.Net5/4.5.1

@proudmonkey seems someone added support for .NET5, if you can extend this to include .NET6, that would be great

That was me. Its just a fork with some added target framework xml. We couldnt wait any longer on the official implementation as it was holding up our move to .Net 5

mattmckinstry avatar Jun 11 '21 16:06 mattmckinstry

All - I've released an RC version just to test out the migration to .NET 5. Alot of code refactoring has been done for v5 and there are breaking changes. I would really appreciate if you could test it out as well: https://www.nuget.org/packages/AutoWrapper.Core/5.0.0-rc

Please provide feedback if there are any issues you encountered. Thank you!

Breaking changes

  • This release only supports .NET 5
  • Middleware has been renamed from UseApiResponseAndExceptionWrapper to UseAutoWrapper. Make sure to update your Startup.cs to use the new name.
  • ProblemDetails is now the default exception format
  • Removed Newtonsoft.Json dependency and replaced it with System.Text.Json
  • Use the interface IApiResponse model instead of the concrete ApiResponse model for returning responses using the default format. This allows you to add your own properties that will wrapped within the Result property.
  • AutoWrapIgnore and RequestDataLogIgnore attributes now leaves under AutoWrapper.Attributes namespace. The implementation was changed from using IActionFilter to use Attribute, eliminating all the request header logic.
  • The following options has been removed:
    • ApiVersion
    • ReferenceLoopHandling
    • UseCustomSchema

ReferenceLoopHandling and DefaultContractResolver aren't still supported in .NET 5 that's why handling reference loop and ApiResponse property mappings will not be supported when targetting .NET 5. .NET Core 3.1 will still use Newtonsoft.Json and it's only supported by AutoWrapper <= v4.5.0

proudmonkey avatar Aug 04 '21 16:08 proudmonkey

Had a quick play.

ApiRequestHandler.HandleSuccessfulRequestAsync does not work when returning a collection.

Think it needs the following change

if (root.ValueKind == JsonValueKind.Object || root.ValueKind == JsonValueKind.Array)

mattmckinstry avatar Aug 11 '21 10:08 mattmckinstry

Thank you! PR for this fix has been submitted. I've found other issues as well and will release a new rc version within the week for us to test it out again :)

proudmonkey avatar Aug 13 '21 14:08 proudmonkey

New rc version has been released: https://www.nuget.org/packages/AutoWrapper.Core/5.0.0-rc-02

proudmonkey avatar Aug 13 '21 18:08 proudmonkey

Handling of ApiProblemDetailsException seems to be broken

Doing the following produces a 500 Internal Server error now throw new ApiProblemDetailsException($"Record with id: {id} does not exist.", Status404NotFound);

mattmckinstry avatar Aug 16 '21 08:08 mattmckinstry

@mattmckinstry - thank you for the feedback. I'll look into this.

proudmonkey avatar Aug 17 '21 22:08 proudmonkey

@mattmckinstry This should now be fixed in rc-03: https://www.nuget.org/packages/AutoWrapper.Core/5.0.0-rc-03

Please keep you feedback coming to better improve this project. Thank you and I appreciate all the support and feedback! ❤️

proudmonkey avatar Aug 25 '21 04:08 proudmonkey

Shame this doesn't work with .NET 6, looks like a great library.

replete avatar Nov 14 '21 15:11 replete

@replete - Not yet :)

proudmonkey avatar Nov 17 '21 15:11 proudmonkey

@proudmonkey any news regarding .NET 6?

binaryplates avatar Apr 08 '23 01:04 binaryplates