viceroypenguin / Going.Plaid

Plaid API .NET library
https://plaid.com
MIT License
72 stars 33 forks source link

Feature 'init-only setters' is not available in C# 8.0 #171

Closed dahlbyk closed 1 year ago

dahlbyk commented 1 year ago

Folks stuck on legacy .NET Framework appreciate that you're targeting .NET Standard 2.0, but without access to C# 9.0 there are significant limitations in how this library can be consumed due to CS8400:

Feature 'init-only setters' is not available in C# 8.0. Please use language version 9.0 or greater.

This essentially prevents constructing any of the types from this project without reflection, so calling APIs works but mocking responses/errors does not.

A few options come to mind:

  1. Do nothing. .NET Framework folks will find this issue closed as wontfix.
  2. Add constructors to some/all the records so that they can be constructed in C# 8.0 without using the setters.
  3. Use public set like we used to. Less correct; more inclusive.

Thoughts?

viceroypenguin commented 1 year ago

Unfortunately, I think that the number of users that this affects does not outweigh the costs that adding an alternative will have, either in maintenance or in consumption.

I appreciate the request!